diff --git a/guideGlobalMetadata.json b/guideGlobalMetadata.json index 1700197b7..1b4fabc8d 100644 --- a/guideGlobalMetadata.json +++ b/guideGlobalMetadata.json @@ -13,6 +13,7 @@ "BlackrockSortingInterface", "CellExplorerSortingInterface", "KiloSortSortingInterface", - "Spike2RecordingInterface" + "Spike2RecordingInterface", + "BrukerTiffSinglePlaneImagingInterface" ] } diff --git a/schemas/json/generated/BrukerTiffSinglePlaneImagingInterface.json b/schemas/json/generated/BrukerTiffSinglePlaneImagingInterface.json new file mode 100644 index 000000000..844834ff9 --- /dev/null +++ b/schemas/json/generated/BrukerTiffSinglePlaneImagingInterface.json @@ -0,0 +1,33 @@ +{ + "required": [], + "properties": { + "BrukerTiffSinglePlaneImagingInterface": { + "required": [ + "folder_path" + ], + "properties": { + "folder_path": { + "format": "directory", + "type": "string", + "description": "The path that points to the folder containing the Bruker TIF image files and configuration files." + }, + "stream_name": { + "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" +} diff --git a/schemas/json/generated/OpenEphysRecordingInterface.json b/schemas/json/generated/OpenEphysRecordingInterface.json index 9accfcf55..f6193ea0c 100644 --- a/schemas/json/generated/OpenEphysRecordingInterface.json +++ b/schemas/json/generated/OpenEphysRecordingInterface.json @@ -16,6 +16,10 @@ "verbose": { "type": "boolean", "default": true + }, + "es_key": { + "type": "string", + "default": "ElectricalSeries" } }, "type": "object", diff --git a/schemas/json/generated/Spike2RecordingInterface.json b/schemas/json/generated/Spike2RecordingInterface.json new file mode 100644 index 000000000..81c785ad8 --- /dev/null +++ b/schemas/json/generated/Spike2RecordingInterface.json @@ -0,0 +1,34 @@ +{ + "required": [], + "properties": { + "Spike2RecordingInterface": { + "required": [ + "file_path" + ], + "properties": { + "file_path": { + "format": "file", + "type": "string", + "description": "Path to CED data file." + }, + "verbose": { + "type": "boolean", + "default": true + }, + "es_key": { + "type": "string", + "default": "ElectricalSeries" + } + }, + "type": "object", + "additionalProperties": true + } + }, + "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" +} diff --git a/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js b/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js index 950a4ebf8..59b3acc74 100644 --- a/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js +++ b/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js @@ -12,6 +12,8 @@ import BlackrockRecordingInterfaceSchema from "../../../../../../schemas/json/ge import BlackrockSortingInterfaceSchema from "../../../../../../schemas/json/generated/BlackrockSortingInterface.json"; import CellExplorerSortingInterfaceSchema from "../../../../../../schemas/json/generated/CellExplorerSortingInterface.json"; import KiloSortSortingInterfaceSchema from "../../../../../../schemas/json/generated/KiloSortSortingInterface.json"; +import Spike2RecordingInterfaceSchema from "../../../../../../schemas/json/generated/Spike2RecordingInterface.json"; +import BrukerTiffSinglePlaneImagingInterfaceSchema from "../../../../../../schemas/json/generated/BrukerTiffSinglePlaneImagingInterface.json"; export default { title: "Pages/Guided Mode/Source Data", @@ -49,6 +51,10 @@ globalStateCopy.schema.source_data.properties.CellExplorerSortingInterface = CellExplorerSortingInterfaceSchema.properties.CellExplorerSortingInterface; globalStateCopy.schema.source_data.properties.KiloSortSortingInterface = KiloSortSortingInterfaceSchema.properties.KiloSortSortingInterface; +globalStateCopy.schema.source_data.properties.Spike2RecordingInterface = + Spike2RecordingInterfaceSchema.properties.Spike2RecordingInterface; +globalStateCopy.schema.source_data.properties.BrukerTiffSinglePlaneImagingInterface = + BrukerTiffSinglePlaneImagingInterfaceSchema.properties.BrukerTiffSinglePlaneImagingInterface; const results = globalStateCopy.results; for (let sub in results) { @@ -136,3 +142,18 @@ const KiloSortSortingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState KiloSortSortingInterfaceGlobalCopy.interfaces.interface = KiloSortSortingInterface; KiloSortSortingInterfaceGlobalCopy.schema.source_data = KiloSortSortingInterfaceSchema; KiloSortSortingInterface.args = { activePage, globalState: KiloSortSortingInterfaceGlobalCopy }; + +export const Spike2RecordingInterface = PageTemplate.bind({}); +const Spike2RecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +Spike2RecordingInterfaceGlobalCopy.interfaces.interface = Spike2RecordingInterface; +Spike2RecordingInterfaceGlobalCopy.schema.source_data = Spike2RecordingInterfaceSchema; +Spike2RecordingInterface.args = { activePage, globalState: Spike2RecordingInterfaceGlobalCopy }; + +export const BrukerTiffSinglePlaneImagingInterface = PageTemplate.bind({}); +const BrukerTiffSinglePlaneImagingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +BrukerTiffSinglePlaneImagingInterfaceGlobalCopy.interfaces.interface = BrukerTiffSinglePlaneImagingInterface; +BrukerTiffSinglePlaneImagingInterfaceGlobalCopy.schema.source_data = BrukerTiffSinglePlaneImagingInterfaceSchema; +BrukerTiffSinglePlaneImagingInterface.args = { + activePage, + globalState: BrukerTiffSinglePlaneImagingInterfaceGlobalCopy, +}; diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js index d9a147336..b8d88218d 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js @@ -62,7 +62,9 @@ export class GuidedSourceDataPage extends ManagedPage { interfaces: this.info.globalState.interfaces, }), }) - .then((res) => res.json()) + .then(async (res) => { + return (0, eval)(`(${await res.text()})`); + }) .catch((e) => { Swal.close(); stillFireSwal = false;