Skip to content

Commit

Permalink
Merge branch 'tutorial-base' of https://github.com/NeurodataWithoutBo…
Browse files Browse the repository at this point in the history
…rders/nwb-guide into tutorial-base
  • Loading branch information
garrettmflynn committed Mar 27, 2024
2 parents 06def87 + 4cbd483 commit ed4034f
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 22 deletions.
12 changes: 6 additions & 6 deletions docs/tutorials/dataset.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
The Dataset
=======================================

Our tutorials focus on converting extracellular electrophysiology data in the SpikeGLX and Phy formats.
To get you started as quickly as possible, we’ve created a way to generate this Neuropixel-like dataset at the click of a button!
Our tutorials focus on converting extracellular electrophysiology data in the SpikeGLX and Phy formats.
To get you started as quickly as possible, we’ve created a way to generate this Neuropixel-like dataset at the click of a button!

.. note::
The **SpikeGLX** data format stores electrophysiology recordings
The **Phy** data format stores spike sorting results.

Navigate to the **Settings** page using the main sidebar and initiate the dataset generation
by pressing the Generate button in the top-right corner.
Navigate to the **Settings** page using the main sidebar and initiate the dataset generation
by pressing the Generate button in the top-right corner.

.. figure:: ./screenshots/1-dataset-creation.png
:align: center
Expand All @@ -31,7 +31,7 @@ The generated dataset will be organized as follows:
│ │ │ │ ├── mouse1_Session1_g0_imec.lf.bin
│ │ │ │ └── mouse1_Session1_g0_imec.lf.meta
│ │ │ └── mouse1_Session1_phy/
│ │ │
│ │ │
│ │ └── mouse1_Session2/
│ │ ├── mouse1_Session2_g0/
│ │ │ ...
Expand All @@ -44,5 +44,5 @@ The generated dataset will be organized as follows:
└── mouse2_Session2/
...
Now you’re ready to start your first conversion using the NWB GUIDE!
2 changes: 1 addition & 1 deletion docs/tutorials/dataset_publication.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Dataset Publication
=======================================
Coming soon...
Coming soon...
4 changes: 2 additions & 2 deletions docs/tutorials/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tutorials
=======================================
The NWB Graphical User Interface for Data Entry (GUIDE) is a desktop tool for converting neurophysiological data
to the Neurodata Without Borders (NWB) format and uploading to the DANDI Archive. In these tutorials, we detail this
The NWB Graphical User Interface for Data Entry (GUIDE) is a desktop tool for converting neurophysiological data
to the Neurodata Without Borders (NWB) format and uploading to the DANDI Archive. In these tutorials, we detail this
process from initial setup to final upload.

Before you begin these tutorials, **you'll need to generate the tutorial dataset** using the instructions on the Dataset page.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/multiple_sessions.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Handling Multiple Sessions
=======================================
Coming soon...
Coming soon...
2 changes: 1 addition & 1 deletion docs/tutorials/next_steps.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
What's Next?
=======================================
Coming soon...
Coming soon...
2 changes: 1 addition & 1 deletion docs/tutorials/single_session.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Converting a Single Session
=======================================
Coming soon...
Coming soon...
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export class GuidedPathExpansionPage extends Page {

// Map existing results to new subject information (if available)
const existingResults = Object.values(Object.values(globalState.results ?? {})[0] ?? {})[0] ?? {};

const existingMetadata = existingResults.metadata;
const existingSourceData = existingResults.source_data;

Expand Down Expand Up @@ -351,6 +352,8 @@ export class GuidedPathExpansionPage extends Page {
throw message;
}

// globalState.results = {} // Clear existing results

// Save an overall results object organized by subject and session
merge({ results }, globalState);

Expand Down
41 changes: 31 additions & 10 deletions src/renderer/src/stories/pages/guided-mode/results/GuidedResults.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
import { html } from "lit";
import { unsafeSVG } from "lit/directives/unsafe-svg.js";
import folderOpenSVG from "../../../assets/folder_open.svg?raw";

import { Page } from "../../Page.js";
import { getStubArray } from "../options/GuidedStubPreview.js";
import { getSharedPath } from "../../../preview/NWBFilePreview.js";

import { electron, path } from "../../../../electron/index.js";
const { ipcRenderer } = electron;

export class GuidedResultsPage extends Page {
constructor(...args) {
super(...args);
}

header = {
controls: () =>
html`<nwb-button
size="small"
@click=${() => {
if (ipcRenderer) ipcRenderer.send("showItemInFolder", this.#sharedPath());
}}
>${unsafeSVG(folderOpenSVG)}</nwb-button
>`,
};

footer = {};

#sharedPath = () => {
const { conversion } = this.info.globalState;
if (!conversion) return "";
return getSharedPath(getStubArray(conversion).map((item) => item.file));
};

updated() {
this.save(); // Save the current state
}
Expand All @@ -20,16 +45,12 @@ export class GuidedResultsPage extends Page {

return html`
<p>Your data was successfully converted to NWB!</p>
${Object.entries(conversion)
.map(([subject, sessions]) => {
return html` <h3 style="margin: 0; padding: 0;">sub-${subject}</h3>
<ol style="margin: 10px 0px; padding-top: 0;">
${Object.entries(sessions).map(([session, info]) => {
return html`<li><b>ses-${session}</b>${info.file}</li>`;
})}
</ol>`;
})
.flat()}
<ol style="margin: 10px 0px; padding-top: 0;">
${getStubArray(conversion)
.map(({ file }) => file.split(path.sep).slice(-1)[0])
.sort()
.map((id) => html`<li>${id}</li>`)}
</ol>
`;
}
}
Expand Down

0 comments on commit ed4034f

Please sign in to comment.