Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ To see Brainchop **v4** in action please click [here](https://neuroneural.githu

For **v3** click [here](https://neuroneural.github.io/brainchop/v3).

You can link directly to a specific model using the `?model=` URL parameter, e.g. [neuroneural.github.io/brainchop?model=skull-strip](https://neuroneural.github.io/brainchop?model=skull-strip).

<br>


Expand Down
11 changes: 11 additions & 0 deletions brainchop-parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const brainChopOpts = {
const inferenceModelsList = [
{
id: 1,
shortname: 'tissue-gwm',
type: 'Segmentation',
path: '/models/model5_gw_ae/model.json',
modelName: '\u26A1 Tissue GWM (light)',
Expand All @@ -48,6 +49,7 @@ const inferenceModelsList = [
},
{
id: 2,
shortname: 'skull-strip',
type: 'Brain_Extraction',
path: '/models/mindgrab/model.json',
modelName: '\u{1FA93}\u{1F9E0} omnimodal Skull Stripping',
Expand All @@ -74,6 +76,7 @@ const inferenceModelsList = [
},
{
id: 3,
shortname: 'subcortical-gwm',
type: 'Atlas',
path: '/models/model30chan18cls/model.json',
modelName: '\u{1FA93} Subcortical + GWM',
Expand All @@ -99,6 +102,7 @@ const inferenceModelsList = [
},
{
id: 4,
shortname: 'aparc50',
type: 'Atlas',
path: '/models/model30chan50cls/model.json',
modelName: '\u{1F52A} Aparc+Aseg 50',
Expand All @@ -124,6 +128,7 @@ const inferenceModelsList = [
},
{
id: 5,
shortname: 'aparc104',
type: 'Atlas',
path: '/models/model21_104class/model.json',
modelName: '\u{1F52A} Aparc+Aseg 104',
Expand Down Expand Up @@ -155,6 +160,7 @@ const inferenceModelsList = [
},
{
id: 7,
shortname: 'tissue-gwm-highacc',
type: 'Segmentation',
path: '/models/model20chan3cls/model.json',
modelName: '\u{1F52A} Tissue GWM (High Acc)',
Expand All @@ -179,6 +185,7 @@ const inferenceModelsList = [
},
{
id: 8,
shortname: 'subcortical-gwm-small',
type: 'Atlas',
path: '/models/model18cls/model.json',
modelName: '\u{1FA93} Subcortical + GWM (Small Model)',
Expand All @@ -204,6 +211,7 @@ const inferenceModelsList = [
},
{
id: 9,
shortname: 'brain-extract-fast',
type: 'Brain_Extraction',
path: '/models/model5_gw_ae/model.json',
modelName: '\u26A1 Extract the Brain (FAST)',
Expand All @@ -226,6 +234,7 @@ const inferenceModelsList = [
},
{
id: 10,
shortname: 'brain-extract-highacc',
type: 'Brain_Extraction',
path: '/models/model11_gw_ae/model.json',
modelName: '\u{1F52A} Extract the Brain (High Acc, Slow)',
Expand All @@ -249,6 +258,7 @@ const inferenceModelsList = [
},
{
id: 11,
shortname: 'brain-mask-fast',
type: 'Brain_Masking',
path: '/models/model5_gw_ae/model.json',
modelName: '\u26A1 Brain Mask (FAST)',
Expand All @@ -272,6 +282,7 @@ const inferenceModelsList = [
},
{
id: 12,
shortname: 'brain-mask-highacc',
type: 'Brain_Masking',
path: '/models/model11_gw_ae/model.json',
modelName: '\u{1F52A} Brain Mask (High Acc, Low Mem)',
Expand Down
14 changes: 11 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,17 @@ async function main() {
// Use URLSearchParams to correctly parse the query string.
const urlParams = new URLSearchParams(window.location.search);
const modelParam = urlParams.get("model");
if (modelParam && modelParam < inferenceModelsList.length) {
modelSelect.value = modelParam;
runSelectedInference();
const modelIdxParam = urlParams.get("model_idx");
let urlModelIdx = -1;
if (modelParam) {
urlModelIdx = inferenceModelsList.findIndex(m => m.shortname === modelParam);
} else if (modelIdxParam && modelIdxParam < inferenceModelsList.length) {
urlModelIdx = parseInt(modelIdxParam);
}
if (urlModelIdx >= 0) {
modelSelect.value = urlModelIdx;
await runSelectedInference();
modelSelect.value = urlModelIdx;
}
}

Expand Down