Skip to content

Commit

Permalink
Merge pull request #487 from NeurodataWithoutBorders/bruker-single-co…
Browse files Browse the repository at this point in the history
…nverter

Add BrukerTiffSinglePlaneConverter
  • Loading branch information
CodyCBakerPhD authored Oct 31, 2023
2 parents 4815403 + 5e1b58e commit 11b6fc8
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 3 deletions.
4 changes: 2 additions & 2 deletions generateInterfaceSchema.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path
import json
from neuroconv import datainterfaces, NWBConverter
from neuroconv import converters, datainterfaces, NWBConverter

filepath = Path("guideGlobalMetadata.json")
generatedJSONSchemaPath = Path("schemas", "json", "generated")
Expand All @@ -16,7 +16,7 @@

class CustomNWBConverter(NWBConverter):
data_interface_classes = {
custom_name: getattr(datainterfaces, interface_name)
custom_name: getattr(datainterfaces, interface_name, getattr(converters, interface_name, None))
for custom_name, interface_name in interface_class_dict.items()
}

Expand Down
5 changes: 4 additions & 1 deletion guideGlobalMetadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"AudioInterface",
"MiniscopeBehaviorInterface",
"EDFRecordingInterface",
"SpikeGLXConverterPipe"
"SpikeGLXConverterPipe",
"BrukerTiffSinglePlaneConverter",
"BrukerTiffMultiPlaneConverter",
"MiniscopeConverter"
]
}
35 changes: 35 additions & 0 deletions schemas/json/generated/BrukerTiffMultiPlaneConverter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"required": [],
"properties": {
"BrukerTiffMultiPlaneConverter": {
"required": [
"folder_path"
],
"properties": {
"folder_path": {
"format": "directory",
"type": "string"
},
"plane_separation_type": {
"enum": [
"disjoint",
"contiguous"
]
},
"verbose": {
"type": "boolean",
"default": false
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
29 changes: 29 additions & 0 deletions schemas/json/generated/BrukerTiffSinglePlaneConverter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"required": [],
"properties": {
"BrukerTiffSinglePlaneConverter": {
"required": [
"folder_path"
],
"properties": {
"folder_path": {
"format": "directory",
"type": "string"
},
"verbose": {
"type": "boolean",
"default": false
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
33 changes: 33 additions & 0 deletions schemas/json/generated/EDFRecordingInterface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"required": [],
"properties": {
"EDFRecordingInterface": {
"required": [
"file_path"
],
"properties": {
"file_path": {
"format": "file",
"type": "string"
},
"verbose": {
"type": "boolean",
"default": true
},
"es_key": {
"type": "string",
"default": "ElectricalSeries"
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
29 changes: 29 additions & 0 deletions schemas/json/generated/MiniscopeConverter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"required": [],
"properties": {
"MiniscopeConverter": {
"required": [
"folder_path"
],
"properties": {
"folder_path": {
"format": "directory",
"type": "string"
},
"verbose": {
"type": "boolean",
"default": true
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
30 changes: 30 additions & 0 deletions schemas/json/generated/SpikeGLXConverterPipe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"required": [],
"properties": {
"SpikeGLXConverterPipe": {
"required": [
"folder_path"
],
"properties": {
"folder_path": {
"format": "directory",
"type": "string",
"description": "Path to the folder containing SpikeGLX streams."
},
"verbose": {
"type": "boolean",
"default": false
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
45 changes: 45 additions & 0 deletions src/renderer/src/stories/pages/guided-mode/SourceData.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import SLEAPInterfaceSchema from "../../../../../../schemas/json/generated/SLEAP
import FicTracDataInterfaceSchema from "../../../../../../schemas/json/generated/FicTracDataInterface.json";
import AudioInterfaceSchema from "../../../../../../schemas/json/generated/AudioInterface.json";
import MiniscopeBehaviorInterfaceSchema from "../../../../../../schemas/json/generated/MiniscopeBehaviorInterface.json";
import EDFRecordingInterfaceSchema from "../../../../../../schemas/json/generated/EDFRecordingInterface.json";
import SpikeGLXConverterPipeSchema from "../../../../../../schemas/json/generated/SpikeGLXConverterPipe.json";
import BrukerTiffSinglePlaneConverterSchema from "../../../../../../schemas/json/generated/BrukerTiffSinglePlaneConverter.json";
import BrukerTiffMultiPlaneConverterSchema from "../../../../../../schemas/json/generated/BrukerTiffMultiPlaneConverter.json";
import MiniscopeConverterSchema from "../../../../../../schemas/json/generated/MiniscopeConverter.json";

export default {
title: "Pages/Guided Mode/Source Data",
Expand Down Expand Up @@ -116,6 +121,16 @@ globalStateCopy.schema.source_data.properties.FicTracDataInterface =
globalStateCopy.schema.source_data.properties.AudioInterface = AudioInterfaceSchema.properties.AudioInterface;
globalStateCopy.schema.source_data.properties.MiniscopeBehaviorInterface =
MiniscopeBehaviorInterfaceSchema.properties.MiniscopeBehaviorInterface;
globalStateCopy.schema.source_data.properties.EDFRecordingInterface =
EDFRecordingInterfaceSchema.properties.EDFRecordingInterface;
globalStateCopy.schema.source_data.properties.SpikeGLXConverterPipe =
SpikeGLXConverterPipeSchema.properties.SpikeGLXConverterPipe;
globalStateCopy.schema.source_data.properties.BrukerTiffSinglePlaneConverter =
BrukerTiffSinglePlaneConverterSchema.properties.BrukerTiffSinglePlaneConverter;
globalStateCopy.schema.source_data.properties.BrukerTiffMultiPlaneConverter =
BrukerTiffMultiPlaneConverterSchema.properties.BrukerTiffMultiPlaneConverter;
globalStateCopy.schema.source_data.properties.MiniscopeConverter =
MiniscopeConverterSchema.properties.MiniscopeConverter;

const results = globalStateCopy.results;
for (let sub in results) {
Expand Down Expand Up @@ -344,3 +359,33 @@ const MiniscopeBehaviorInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalSta
MiniscopeBehaviorInterfaceGlobalCopy.interfaces.interface = MiniscopeBehaviorInterface;
MiniscopeBehaviorInterfaceGlobalCopy.schema.source_data = MiniscopeBehaviorInterfaceSchema;
MiniscopeBehaviorInterface.args = { activePage, globalState: MiniscopeBehaviorInterfaceGlobalCopy };

export const EDFRecordingInterface = PageTemplate.bind({});
const EDFRecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState));
EDFRecordingInterfaceGlobalCopy.interfaces.interface = EDFRecordingInterface;
EDFRecordingInterfaceGlobalCopy.schema.source_data = EDFRecordingInterfaceSchema;
EDFRecordingInterface.args = { activePage, globalState: EDFRecordingInterfaceGlobalCopy };

export const SpikeGLXConverterPipe = PageTemplate.bind({});
const SpikeGLXConverterPipeGlobalCopy = JSON.parse(JSON.stringify(globalState));
SpikeGLXConverterPipeGlobalCopy.interfaces.interface = SpikeGLXConverterPipe;
SpikeGLXConverterPipeGlobalCopy.schema.source_data = SpikeGLXConverterPipeSchema;
SpikeGLXConverterPipe.args = { activePage, globalState: SpikeGLXConverterPipeGlobalCopy };

export const BrukerTiffSinglePlaneConverter = PageTemplate.bind({});
const BrukerTiffSinglePlaneConverterGlobalCopy = JSON.parse(JSON.stringify(globalState));
BrukerTiffSinglePlaneConverterGlobalCopy.interfaces.interface = BrukerTiffSinglePlaneConverter;
BrukerTiffSinglePlaneConverterGlobalCopy.schema.source_data = BrukerTiffSinglePlaneConverterSchema;
BrukerTiffSinglePlaneConverter.args = { activePage, globalState: BrukerTiffSinglePlaneConverterGlobalCopy };

export const BrukerTiffMultiPlaneConverter = PageTemplate.bind({});
const BrukerTiffMultiPlaneConverterGlobalCopy = JSON.parse(JSON.stringify(globalState));
BrukerTiffMultiPlaneConverterGlobalCopy.interfaces.interface = BrukerTiffMultiPlaneConverter;
BrukerTiffMultiPlaneConverterGlobalCopy.schema.source_data = BrukerTiffMultiPlaneConverterSchema;
BrukerTiffMultiPlaneConverter.args = { activePage, globalState: BrukerTiffMultiPlaneConverterGlobalCopy };

export const MiniscopeConverter = PageTemplate.bind({});
const MiniscopeConverterGlobalCopy = JSON.parse(JSON.stringify(globalState));
MiniscopeConverterGlobalCopy.interfaces.interface = MiniscopeConverter;
MiniscopeConverterGlobalCopy.schema.source_data = MiniscopeConverterSchema;
MiniscopeConverter.args = { activePage, globalState: MiniscopeConverterGlobalCopy };

0 comments on commit 11b6fc8

Please sign in to comment.