diff --git a/paths.config.json b/paths.config.json index 1051492e7..86631532e 100644 --- a/paths.config.json +++ b/paths.config.json @@ -3,7 +3,7 @@ "subfolders": { "progress": ["pipelines"], "conversions": ["conversions"], - "stubs": ["stubs"], + "preview": ["preview"], "tutorial": ["tutorial"] } } diff --git a/pyflask/app.py b/pyflask/app.py index 890d9bede..edd60db62 100644 --- a/pyflask/app.py +++ b/pyflask/app.py @@ -84,8 +84,8 @@ def send_conversions(path): return send_from_directory(CONVERSION_SAVE_FOLDER_PATH, path) -@app.route("/stubs/") -def send_stubs(path): +@app.route("/preview/") +def send_preview(path): return send_from_directory(STUB_SAVE_FOLDER_PATH, path) diff --git a/pyflask/manageNeuroconv/info/urls.py b/pyflask/manageNeuroconv/info/urls.py index ef9a4bd8c..9672160e6 100644 --- a/pyflask/manageNeuroconv/info/urls.py +++ b/pyflask/manageNeuroconv/info/urls.py @@ -20,7 +20,7 @@ def resource_path(relative_path): ) # NOTE: Must have pyflask for running the GUIDE as a whole, but errors for just the server f = path_config.open() data = json.load(f) -STUB_SAVE_FOLDER_PATH = Path(Path.home(), data["root"], *data["subfolders"]["stubs"]) +STUB_SAVE_FOLDER_PATH = Path(Path.home(), data["root"], *data["subfolders"]["preview"]) CONVERSION_SAVE_FOLDER_PATH = Path(Path.home(), data["root"], *data["subfolders"]["conversions"]) TUTORIAL_SAVE_FOLDER_PATH = Path(Path.home(), data["root"], *data["subfolders"]["tutorial"]) diff --git a/schemas/json/project/globals.json b/schemas/json/project/globals.json index 226ecf4f2..66280e879 100644 --- a/schemas/json/project/globals.json +++ b/schemas/json/project/globals.json @@ -6,10 +6,10 @@ "description": "Provide a custom output location for your NWB files. Will default to ~/NWB_GUIDE/conversions" }, - "stub_output_folder": { + "preview_output_folder": { "type": "string", "format": "directory", - "description": "Provide a custom output location for your NWB stub files. Will default to ~/NWB_GUIDE/stubs" + "description": "Provide a custom output location for your NWB stub files. Will default to ~/NWB_GUIDE/preview. These files are expected to much smaller than the conversion files (only ~MB in scale)." } } } diff --git a/src/renderer/src/dependencies/simple.js b/src/renderer/src/dependencies/simple.js index 97f8d2148..e51ca67fb 100644 --- a/src/renderer/src/dependencies/simple.js +++ b/src/renderer/src/dependencies/simple.js @@ -12,8 +12,8 @@ export const homeDirectory = app?.getPath("home") ?? ""; export const appDirectory = homeDirectory ? joinPath(homeDirectory, paths.root) : ""; export const guidedProgressFilePath = homeDirectory ? joinPath(appDirectory, ...paths.subfolders.progress) : ""; -export const stubSaveFolderPath = homeDirectory - ? joinPath(homeDirectory, paths["root"], ...paths.subfolders.stubs) +export const previewSaveFolderPath = homeDirectory + ? joinPath(homeDirectory, paths["root"], ...paths.subfolders.preview) : ""; export const conversionSaveFolderPath = homeDirectory ? joinPath(homeDirectory, paths["root"], ...paths.subfolders.conversions) diff --git a/src/renderer/src/progress/index.js b/src/renderer/src/progress/index.js index 212954f47..5e3cc8fad 100644 --- a/src/renderer/src/progress/index.js +++ b/src/renderer/src/progress/index.js @@ -1,13 +1,6 @@ import Swal from "sweetalert2"; -import { - guidedProgressFilePath, - reloadPageToHome, - isStorybook, - appDirectory, - stubSaveFolderPath, - conversionSaveFolderPath, -} from "../dependencies/simple.js"; +import { guidedProgressFilePath, reloadPageToHome, isStorybook, appDirectory } from "../dependencies/simple.js"; import { fs } from "../electron/index.js"; import { joinPath, runOnLoad } from "../globals.js"; import { merge } from "../stories/pages/utils.js"; diff --git a/src/renderer/src/progress/operations.js b/src/renderer/src/progress/operations.js index 20ec92b2c..3e0e70fa4 100644 --- a/src/renderer/src/progress/operations.js +++ b/src/renderer/src/progress/operations.js @@ -1,5 +1,5 @@ import { joinPath } from "../globals"; -import { conversionSaveFolderPath, guidedProgressFilePath, stubSaveFolderPath } from "../dependencies/simple"; +import { conversionSaveFolderPath, guidedProgressFilePath, previewSaveFolderPath } from "../dependencies/simple"; import { fs } from "../electron"; export const remove = (name) => { @@ -11,8 +11,8 @@ export const remove = (name) => { else localStorage.removeItem(progressFilePathToDelete); if (fs) { - // delete default stub location - fs.rmSync(joinPath(stubSaveFolderPath, name), { recursive: true, force: true }); + // delete default preview location + fs.rmSync(joinPath(previewSaveFolderPath, name), { recursive: true, force: true }); // delete default conversion location fs.rmSync(joinPath(conversionSaveFolderPath, name), { recursive: true, force: true }); diff --git a/src/renderer/src/stories/Main.js b/src/renderer/src/stories/Main.js index 9a505cabd..78ce1f2be 100644 --- a/src/renderer/src/stories/Main.js +++ b/src/renderer/src/stories/Main.js @@ -4,6 +4,8 @@ import { GuidedFooter } from "./pages/guided-mode/GuidedFooter"; import { GuidedCapsules } from "./pages/guided-mode/GuidedCapsules.js"; import { GuidedHeader } from "./pages/guided-mode/GuidedHeader.js"; +import { unsafeHTML } from "lit/directives/unsafe-html.js"; + const componentCSS = ` :host { display: grid; @@ -147,7 +149,7 @@ export class Main extends LitElement { >

${title}

- ${subtitle} + ${unsafeHTML(subtitle)}
${controls}
diff --git a/src/renderer/src/stories/OptionalSection.js b/src/renderer/src/stories/OptionalSection.js index aa46e45d2..90d27e901 100644 --- a/src/renderer/src/stories/OptionalSection.js +++ b/src/renderer/src/stories/OptionalSection.js @@ -6,11 +6,13 @@ export class OptionalSection extends LitElement { static get styles() { return css` :host { + display: block; text-align: center; } h2 { margin: 0; + margin-bottom: 15px; } .optional-section__content { @@ -39,7 +41,7 @@ export class OptionalSection extends LitElement { constructor(props) { super(); this.header = props.header ?? ""; - this.description = props.description ?? "This is the description of the optional section."; + this.description = props.description ?? ""; this.content = props.content ?? ""; this.altContent = props.altContent ?? ""; this.state = props.state; diff --git a/src/renderer/src/stories/pages/Page.js b/src/renderer/src/stories/pages/Page.js index 1e0fffcef..0b49f0a5e 100644 --- a/src/renderer/src/stories/pages/Page.js +++ b/src/renderer/src/stories/pages/Page.js @@ -156,7 +156,7 @@ export class Page extends LitElement { const { subject, session, globalState = this.info.globalState } = info; const file = `sub-${subject}/sub-${subject}_ses-${session}.nwb`; - const { conversion_output_folder, stub_output_folder, name } = globalState.project; + const { conversion_output_folder, preview_output_folder, name } = globalState.project; // Resolve the correct session info from all of the metadata for this conversion const sessionInfo = { @@ -166,7 +166,7 @@ export class Page extends LitElement { const result = await runConversion( { - output_folder: conversionOptions.stub_test ? stub_output_folder : conversion_output_folder, + output_folder: conversionOptions.stub_test ? preview_output_folder : conversion_output_folder, project_name: name, nwbfile_path: file, overwrite: true, // We assume override is true because the native NWB file dialog will not allow the user to select an existing file (unless they approve the overwrite) diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js index ab9ddeb7b..5e9fafcc0 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js @@ -30,6 +30,11 @@ export class GuidedMetadataPage extends ManagedPage { }; form; + + header = { + subtitle: "Edit all metadata for this conversion at the session level", + }; + footer = { next: "Run Conversion Preview", onNext: async () => { diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js index 3b1705405..5e6d0beeb 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js @@ -17,6 +17,10 @@ export class GuidedPathExpansionPage extends Page { super(...args); } + header = { + subtitle: "Automatic source data detection for multiple subjects / sessions", + }; + beforeSave = async () => { const globalState = this.info.globalState; merge({ structure: this.localState }, globalState); // Merge the actual entries into the structure @@ -140,7 +144,6 @@ export class GuidedPathExpansionPage extends Page { optional = new OptionalSection({ header: "Would you like to locate data programmatically?", - description: html`

Automatically detect source data for multiple subjects and sessions.

`, onChange: () => (this.unsavedUpdates = true), // altContent: this.altForm, }); @@ -179,6 +182,7 @@ export class GuidedPathExpansionPage extends Page { pathExpansionInfoBox.style.margin = "10px 0px"; this.optional.innerHTML = ""; + this.optional.style.marginTop = "15px"; this.optional.append(pathExpansionInfoBox, form); form.style.width = "100%"; 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 dd9c9f872..d9a147336 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js @@ -17,6 +17,11 @@ export class GuidedSourceDataPage extends ManagedPage { merge(this.localState, this.info.globalState); }; + header = { + subtitle: + "Specify the file and folder locations on your local system for each interface, as well as any additional details that might be required", + }; + footer = { next: "Request Metadata Schema", onNext: async () => { diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedStructure.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedStructure.js index c735b6161..7d6fe9bbe 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedStructure.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedStructure.js @@ -29,6 +29,10 @@ export class GuidedStructurePage extends Page { this.searchModal.appendChild(this.search); } + header = { + subtitle: "Select all interfaces which apply to this experiment", + }; + search = new Search({ showAllWhenEmpty: true, }); diff --git a/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js b/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js index 075f5d4f7..e17b0a74d 100644 --- a/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js +++ b/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js @@ -33,7 +33,7 @@ export class GuidedInspectorPage extends Page { } header = { - subtitle: () => `${getStubArray(this.info.globalState.preview.stubs).length} Files`, + subtitle: `The NWB Inspector has scanned your files for adherence to best practices`, controls: () => html` `${getStubArray(this.info.globalState.preview.stubs).length} Files`, + subtitle: `Preview file contents on truncated files using the Neurosift application`, controls: () => html` { diff --git a/src/renderer/src/stories/pages/guided-mode/results/GuidedResults.js b/src/renderer/src/stories/pages/guided-mode/results/GuidedResults.js index 882041d34..06665b3b3 100644 --- a/src/renderer/src/stories/pages/guided-mode/results/GuidedResults.js +++ b/src/renderer/src/stories/pages/guided-mode/results/GuidedResults.js @@ -16,7 +16,7 @@ export class GuidedResultsPage extends Page { const { dandiset_id } = this.info.globalState.upload?.info ?? {}; - return new DandiResults({ id: dandiset_id, files: conversion }); + return html`
${new DandiResults({ id: dandiset_id, files: conversion })}
`; } } diff --git a/src/renderer/src/stories/pages/guided-mode/setup/GuidedNewDatasetInfo.js b/src/renderer/src/stories/pages/guided-mode/setup/GuidedNewDatasetInfo.js index 368474643..af3d08bc3 100644 --- a/src/renderer/src/stories/pages/guided-mode/setup/GuidedNewDatasetInfo.js +++ b/src/renderer/src/stories/pages/guided-mode/setup/GuidedNewDatasetInfo.js @@ -28,6 +28,10 @@ export class GuidedNewDatasetPage extends Page { #nameNotification; + header = { + subtitle: "Enter a name for this pipeline and specify the base folders to save all outputs to", + }; + footer = { onNext: async () => { const globalState = this.info.globalState.project; @@ -89,8 +93,14 @@ export class GuidedNewDatasetPage extends Page { info.title = `${info.label} Global Metadata`; return info; }); + console.log(pages); - pages.forEach((page) => this.addPage(page.info.label, page)); + pages.forEach((page) => { + page.header = { + subtitle: `Enter any ${page.info.label}-level metadata that can serve as the common default across each experiment session`, + }; + this.addPage(page.info.label, page); + }); this.form = new JSONSchemaForm({ schema, diff --git a/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js b/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js index e9052bc4f..ef3e71889 100644 --- a/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js +++ b/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js @@ -13,7 +13,7 @@ export class GuidedSubjectsPage extends Page { } header = { - subtitle: "Cross-session metadata applied to the final file metadata", + subtitle: "Enter all metadata known about each experiment subject", }; beforeSave = () => { diff --git a/src/renderer/src/stories/preview/Neurosift.js b/src/renderer/src/stories/preview/Neurosift.js index cc5374af3..622148da9 100644 --- a/src/renderer/src/stories/preview/Neurosift.js +++ b/src/renderer/src/stories/preview/Neurosift.js @@ -5,7 +5,7 @@ import { Loader } from "../Loader"; export function getURLFromFilePath(file, projectName) { const regexp = new RegExp(`.+(${projectName}.+)`); - return `${baseUrl}/stubs/${file.match(regexp)[1]}`; + return `${baseUrl}/preview/${file.match(regexp)[1]}`; } export class Neurosift extends LitElement { diff --git a/src/renderer/src/stories/preview/inspector/test.json b/src/renderer/src/stories/preview/inspector/test.json index aa7f9d4dc..65e6c36d7 100644 --- a/src/renderer/src/stories/preview/inspector/test.json +++ b/src/renderer/src/stories/preview/inspector/test.json @@ -7,7 +7,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" }, { "message": "Experiment description is missing.", @@ -17,7 +17,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" }, { "message": "Metadata /general/institution is missing.", @@ -27,7 +27,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" }, { "message": "Metadata /general/keywords is missing.", @@ -37,7 +37,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-070623.nwb" }, { "message": "Experimenter is missing.", @@ -47,7 +47,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" }, { "message": "Experiment description is missing.", @@ -57,7 +57,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" }, { "message": "Metadata /general/institution is missing.", @@ -67,7 +67,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" }, { "message": "Metadata /general/keywords is missing.", @@ -77,7 +77,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-070623.nwb" }, { "message": "Experimenter is missing.", @@ -87,7 +87,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" }, { "message": "Experiment description is missing.", @@ -97,7 +97,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" }, { "message": "Metadata /general/institution is missing.", @@ -107,7 +107,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" }, { "message": "Metadata /general/keywords is missing.", @@ -117,7 +117,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse2/sub-mouse2_ses-060623.nwb" }, { "message": "Experimenter is missing.", @@ -127,7 +127,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" }, { "message": "Experiment description is missing.", @@ -137,7 +137,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" }, { "message": "Metadata /general/institution is missing.", @@ -147,7 +147,7 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" }, { "message": "Metadata /general/keywords is missing.", @@ -157,6 +157,6 @@ "object_type": "NWBFile", "object_name": "root", "location": "/", - "file_path": "/Users/garrettflynn/NWB_GUIDE/stubs/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" + "file_path": "/Users/garrettflynn/NWB_GUIDE/preview/NWB GUIDE Tutorial Data/sub-mouse1/sub-mouse1_ses-060623.nwb" } ] diff --git a/src/renderer/src/validation/validation.json b/src/renderer/src/validation/validation.json index d3cfb6d9b..e128942d4 100644 --- a/src/renderer/src/validation/validation.json +++ b/src/renderer/src/validation/validation.json @@ -3,7 +3,7 @@ "name": false, "conversion_output_folder": false, - "stub_output_folder": false, + "preview_output_folder": false, "NWBFile": { "identifier": false,