Mask

53 views
Skip to first unread message

fauxv...@gmail.com

unread,
Nov 28, 2023, 11:29:33 PM11/28/23
to DSI Studio
Hi Frank,

I'm wondering how the mask is generated in DSI Studio? Is there a way to export the generated mask?

Thank you!

Richard

Frank Yeh

unread,
Nov 30, 2023, 3:08:20 PM11/30/23
to fauxv...@gmail.com, DSI Studio
It is done by threshold using Otsu's threshold, followed by morphological defragment and smoothing.

Export QA or dti_fa map and use 0 as the threshold will get the same mask.

Best,
Frank

--
You received this message because you are subscribed to the Google Groups "DSI Studio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dsi-studio+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dsi-studio/b2fecb87-bdab-46bc-853e-394d5e5633c8n%40googlegroups.com.
Message has been deleted

Frank Yeh

unread,
Apr 11, 2024, 9:37:16 AMApr 11
to fauxv...@gmail.com, DSI Studio
Currently it is not feasible.
I would suggest creating a customized mask in NIFTI file and supply them using --mask=my_mask.nii.gz

On Thu, Apr 11, 2024 at 1:11 AM fauxv...@gmail.com <fauxv...@gmail.com> wrote:
Hello Frank,

As we're doing dMRI research, our FOV is a little bit different from normal brain scan. So I'm wondering if it's possible to customize the Otsu thresholding and dilation in Reconstruction step using CLI?

I looked through the DSI Studio Github page and didn't find a CLI script related to Otsu thresholding and dilation under "reconstruction" folder. Would you point a direction for me to locate the script? Sorry I'm at the beginning stage of my PhD so I'm still learning, especially with coding. Your help would be greatly appreciated!

Thank you!

Yunjia Ni, MD
Research Associate
ASU-Barrow Interdisciplinary Graduate Program in Neuroscience 
School of Life Sciences
Arizona State University

Christopher Petty

unread,
May 28, 2024, 9:50:09 AMMay 28
to DSI Studio
If we like the mask generated by the GUI with a specific threshold, how can we recreate that through the CLI during the --action=rec step?  I've tried many different options, but haven't found one that will work.

--cmd="[Step T2a][Threshold]=40" 

Frank Yeh

unread,
May 28, 2024, 9:57:23 AMMay 28
to cmp...@gmail.com, DSI Studio
Could you post the console output when using  --cmd="[Step T2a][Threshold]=40" ?

Christopher Petty

unread,
May 28, 2024, 10:21:54 AMMay 28
to DSI Studio
running reconstruction : /usr/local/bin/dsi_studio --action=rec --source=/Users/cmp12/net/munin/Mathew/GLOW.01/Analysis/BIDS/derivatives/gflow/sub-001/ses-01/sub-001_ses-01_gflow.src.gz --motion_correction=1 --cmd="[Step T2a][Threshold]=50" --template=0 --method=0 --other_output=fa:/Users/cmp12/net/munin/Mathew/GLOW.01/Analysis/BIDS/derivatives/gflow/sub-001/ses-01/sub-001_ses-01_gflow.src.gz --save_src=/Users/cmp12/net/munin/Mathew/GLOW.01/Analysis/BIDS/derivatives/gflow/sub-001/ses-01/sub-001_ses-01_rec-moco_gflow.src.gz

In [13]: subprocess.call(recon_cmd)
    ...:
DSI Studio version: Chen"陳" Feb 25 2024
| DSI Studio version: Chen"陳"
| action=rec
| source=/Users/cmp12/net/munin/Mathew/GLOW.01/Analysis/BIDS/derivatives/gflow/sub-001/ses-01/sub-001_ses-01_gflow.src.gz
| loop=/Users/cmp12/net/munin/Mathew/GLOW.01/Analysis/BIDS/derivatives/gflow/sub-001/ses-01/sub-001_ses-01_gflow.src.gz
|-run rec
| |-open SRC file sub-001_ses-01_gflow.src.gz
| | | generating mask
| | |_729 ms
| |-reconstruction parameters
| | | method=0
| | | odf_resolving=0
| | | record_odf=0
| | | dti_no_high_b=1
| | | other_output=fa:/Users/cmp12/net/munin/Mathew/GLOW.01/Analysis/BIDS/derivatives/gflow/sub-001/ses-01/sub-001_ses-01_gflow.src.gz
| | | r2_weighted=0
| | | thread_count=12
| | | param0=1.25
| | | param1=3000
| | | param2=0.05
| | | template 0: "ICBM152_adult.QA.nii"
| | | template 1: "C57BL6_mouse.QA.nii"
| | | template 2: "dHCP_neonate.QA.nii"
| | | template 3: "INDI_rhesus.QA.nii"
| | | template 4: "Pitt_marmoset.QA.nii"
| | | template 5: "WHS_SD_rat.QA.nii"
| | | template=0
| | |_0 ms
| |-preprocessing
| | | preprocessing=0
| | | motion_correction=1
| | |-apply motion correction...
| | | | dwi (2/7) shift=0 0 0  rotation=0 0 0
| | | | dwi (3/7) shift=-0.17632 0.0293386 0.383687  rotation=-0.000615296 -0.000479961 0.0031845
| | | | dwi (4/7) shift=-0.175063 0.0244119 0.32681  rotation=-0.000615296 -0.000479961 0.0031845
| | | | dwi (5/7) shift=-0.164966 0.00106334 0.335069  rotation=-0.0022306 0.000976402 0.00344507
| | | | dwi (6/7) shift=-0.148071 0.00224562 0.296571  rotation=-0.00444608 0.00157404 0.0031959
| | | | dwi (7/7) shift=-0.136228 -0.0448899 0.260497  rotation=-0.00614229 0.0017129 0.00268357
| | | |_57.817 s
| | |-estimate and registering...
| | | | dwi (2/7) =  shift=0 0 0  rotation=0 0 0
| | | | dwi (3/7) =  shift=-0.17632 0.0293386 0.383687  rotation=-0.000615296 -0.000479961 0.0031845
| | | | dwi (4/7) =  shift=-0.175597 0.023781 0.326432  rotation=-0.000615296 -0.000479961 0.0031845
| | | | dwi (5/7) =  shift=-0.175299 -0.00567827 0.337951  rotation=-0.0025255 0.000923988 0.00329727
| | | | dwi (6/7) =  shift=-0.148864 0.00141404 0.295415  rotation=-0.00444608 0.00157404 0.0031959
| | | | dwi (7/7) =  shift=-0.145217 -0.0548087 0.234642  rotation=-0.00615909 0.00166824 0.00266124
| | | |_1.02315 m
| | |-estimate and registering...
| | | |_601 ms
| | |_1.99723 m
| |-additional processing steps
| | | check_btable=0
| | | cmd="[Step T2a][Threshold]=50"
| | |-"[Step T2a][Threshold]
| | | | param: 50"
| | | |_0 ms
| | | ERROR: unknown command: "[Step T2a][Threshold]
| | |_0 ms
| |_2.00942 m
|_2.00952 m
WARNING: --save_src is not used/recognized.
Out[13]: 1

Frank Yeh

unread,
May 28, 2024, 10:32:17 AMMay 28
to cmp...@gmail.com, DSI Studio
Thank you for the help. I found the bug and fixed it.
Once completed (one hour), please update DSI Studio and see if it works for you.

Best regards,
Frank

Reply all
Reply to author
Forward
0 new messages