Multi-Scale Brain Parcellator

76 views
Skip to first unread message

David Nothdurfter

unread,
Apr 23, 2020, 5:29:24 AM4/23/20
to cmtk-users
Hello,

I am trying to use the Multi-Scale Brain Parcellator to get Lausanne parcecalltions from my T1w images. However, while the first steps (Freesurfer parcecllation/Desikan-Killiany) seem to work fine, the pipeline has encounters problem after that and produces no Lausanne parcellations (there are no new data in the anat ordner). I get the following error messages:

Processing /output_dir/freesurfer/sub-01/mri/ROIv_scale4.nii.gz:
200423-03:52:23,587 nipype.workflow WARNING:
     [Node] Error on "anatomical_pipeline.parcellation_stage.Lausanne2018_parcellation" (/output_dir/cmp/sub-01/tmp/anatomical_pipeline/parcellation_stage/Lausanne2018_parcellation)
200423-03:52:23,637 nipype.workflow ERROR:
     Node Lausanne2018_parcellation failed to run on host c816c9675e76.
200423-03:52:23,654 nipype.workflow ERROR:
Saving crash info to ...(see attached file)

The pipeline then ends with:
Exception: File /output_dir/freesurfer/sub-01/mri/ROIv_scale4.nii.gz does not exist.
Processing with the Multi-scale Brain Parcellator BIDS App finished!

I have tried using different example data, however every T1 image I have used produced the same error.

Does anyone have any idea how to solve this problem?

Thank you so much!

Best
David
crash-20200423-035223-root-Lausanne2018_parcellation-6fa45104-16c7-4601-9020-9a542fd81f48.txt

Sebastien Tourbier

unread,
Apr 27, 2020, 8:24:35 AM4/27/20
to cmtk-...@googlegroups.com
Hi David,
To try to understand better please could you indicate me :
* which version of the multiscalebrainparcellator you are using? (You can get it by running "docker images" and then the version is indicated in the TAG field)
(It seems the one with "latest" version tag (sebastientourbier/multiscalebrainparcellator:latest) is outdated.
The latest version is indeed sebastientourbier/multiscalebrainparcellator:v1.1.1)
* what was the command you used to run the multiscalebrainparcellator (docker run ...) ?
Sebastien

--
You received this message because you are subscribed to the Google Groups "cmtk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cmtk-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cmtk-users/141d58e3-6bdb-4f15-9b0a-37559a2fa6f3%40googlegroups.com.

David Nothdurfter

unread,
Apr 28, 2020, 4:09:43 AM4/28/20
to cmtk-users
Hi Sebastian,

thanks for your reply!
I am indeed using the version with the "latest" tag - I will try to install the v1.1.1 version then and try it again.

The command I was using was
docker run -it --rm \
-v /my_input_directory:/bids_dir \
-v /my_output_directory:/output_dir \
-v /Applications/freesurfer/license.txt:/opt/freesurfer/license.txt \
sebastientourbier/multiscalebrainparcellator \
/bids_dir /output_dir participant --participant_label 01 \
--isotropic_resolution 1.0 \
--thalamic_nuclei \
--hippocampal_subfields \
--brainstem_structures

Is there an error in the command or do you think the outdated version is the problem?

I was also wanting to ask when a new version of the
CMP will be available, as I read in the last post that there may be a bug in the current version and I wanted to wait with the installation till the new version is available.

Thanks so much,
David

To unsubscribe from this group and stop receiving emails from it, send an email to cmtk-...@googlegroups.com.

David Nothdurfter

unread,
Apr 29, 2020, 3:57:44 AM4/29/20
to cmtk-users
Hey Sebastian,

I have downloaded the v1.1.1 version now and tried to run the command with this version. However, I already get an error during the bids validation stage (I did not have that with the previous version):
bids-va...@1.3.12

Unhandled rejection (
  reason: TypeError: Cannot read property 'readdir' of undefined
    at getFilesFromFs (/usr/lib/node_modules/bids-validator/utils/files/readDir.js:264:42)
    at preprocessNode (/usr/lib/node_modules/bids-validator/utils/files/readDir.js:108:16)
    at Object.readDir (/usr/lib/node_modules/bids-validator/utils/files/readDir.js:26:13)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)
    at Function.Module.runMain (module.js:696:11)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
).


Traceback (most recent call last):
  File "/opt/conda/envs/py27msbparc/bin/multiscalebrainparcellator_bidsapp_entrypointscript", line 223, in <module>
    run('bids-validator %s'%args.bids_dir)
  File "/opt/conda/envs/py27msbparc/bin/multiscalebrainparcellator_bidsapp_entrypointscript", line 94, in run
    raise Exception("Non zero return code: %d"%process.returncode)
Exception: Non zero return code: 3

Do you have any idea how to fix this?

Thanks,
David

Sebastien Tourbier

unread,
Apr 29, 2020, 5:23:27 AM4/29/20
to cmtk-...@googlegroups.com
Hi David,
It seems something is going wrong with the BIDS validator. I will investigate this problem.
In the meantime, what is happening if you run it without the BIDS validator, i.e
docker run -it --rm \
-v /my_input_directory:/bids_dir \
-v /my_output_directory:/output_dir \
-v /Applications/freesurfer/license.txt:/bids_dir/code/license.txt \
sebastientourbier/multiscalebrainparcellator:v1.1.0 \
/bids_dir /output_dir participant --participant_label 01 \
--isotropic_resolution 1.0 \
--thalamic_nuclei \
--hippocampal_subfields \
--brainstem_structures \
----skip_bids_validator
?

To unsubscribe from this group and stop receiving emails from it, send an email to cmtk-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cmtk-users/8a3e6a2b-262e-439d-8c8f-8a74ed65095e%40googlegroups.com.

David Nothdurfter

unread,
May 4, 2020, 7:53:58 AM5/4/20
to cmtk-users
Hey Sebastian,

this command did the trick and the parcellator started.
However, I got an error later during the recon-all phase. Recon-all exited with errors - here are parts of the error messages (see the attached file for a detailed log):

200430-06:37:01,244 nipype.interface INFO:
     stdout 2020-04-30T06:37:01.243833:recon-all -s sub-01 exited with ERRORS at Thu Apr 30 06:37:01 UTC 2020
200430-06:37:01,263 nipype.interface INFO:
     stdout 2020-04-30T06:37:01.262285:
200430-06:37:01,266 nipype.interface INFO:
     stdout 2020-04-30T06:37:01.265402:For more details, see the log file /output_dir/freesurfer/sub-01/scripts/recon-all.log
200430-06:37:01,281 nipype.interface INFO:
     stdout 2020-04-30T06:37:01.280320:To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

200430-06:37:06,364 nipype.workflow WARNING:
     [Node] Error on "anatomical_pipeline.segmentation_stage.reconall" (/output_dir/nipype/sub-01/anatomical_pipeline/segmentation_stage/reconall)
200430-06:37:06,418 nipype.workflow ERROR:
     Node reconall failed to run on host df31c1c654a8.
200430-06:37:06,511 nipype.workflow ERROR:
     Saving crash info to /app/crash-20200430-063706-root-reconall-cfaf3ff8-498a-411c-b0ed-a78010bb1ea2.txt

recon-all -s sub-01 exited with ERRORS at Thu Apr 30 06:37:01 UTC 2020

For more details, see the log file /output_dir/freesurfer/sub-01/scripts/recon-all.log
To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

Standard error:

Return code: 1
###################################################################

Processing with the Multi-scale Brain Parcellator BIDS App finished!
###################################################################

I then tried to test whether my freesurfer version may have problems and used recon-all on the same data directly with freesurfer - this produced no errors.

Do you have any idea how to fix this/ what the problem may be?

Thanks so much.
Best
David
crash-20200430-063706-root-reconall-cfaf3ff8-498a-411c-b0ed-a78010bb1ea2.txt

Pavan Chaggar

unread,
May 4, 2020, 8:35:20 AM5/4/20
to cmtk-users
Hi David, Sebastien, 

I was having the same issue as David and tried the advice given. Running: 

docker run -it --rm -v /working_directory/ds001:/bids_dir -v /working_directory/ds001/derivatives:/output_dir -v /working_directory/license.txt:/bids_dir/code/license.txt sebastientourbier/multiscalebrainparcellator:v1.1.1 /bids_dir /output_dir participant --participant_label 01 --isotropic_resolution 1.0 --thalamic_nuclei --hippocampal_subfields --brainstem_structures --skip_bids_validator


worked for me and the process has finished without errors. 

I was originally placing the freesurfer licence.txt file in the /opt/freesurfer directory, as this was necessary for the programme to start running recon-all in the first instance. However, using /opt/freesurer instead of /bids_dir_code  caused an error when I ran the above command, stating that I needed to update my freesurfer licence. In my case, moving the licence.txt file to /bids_dir/code was necessary for the code to finish. perhaps

Not sure if this will also work for you, David, but thought it was worth sharing anyway! 

Thanks, 
Pavan

Sebastien Tourbier

unread,
May 5, 2020, 10:16:07 AM5/5/20
to cmtk-users
Hi David and thanks Pavan for sharing it!

To know more about what is wrong in freesurfer recon-all it would be great if you can provide with the content of <your/output-dir>/freesurfer/sub-01/
scripts/recon-all.log

If this is related to a License problem, the way Pavan made it working should work for you.

Otherwise, you still can use your already precomputed Freesurfer outputs (mri/, label/, scripts/, folders) by just moving them in the corresponding <your/output-dir>/freesurfer/sub-<participant_label>/ and run the multi-scale brain parcellator from there. With the help of Nipype, it should automicatically detect and reuse the precomputed recon-all outputs and resume to the creation of the Lausanne multi-scale parcelllation.

David Nothdurfter

unread,
May 8, 2020, 5:14:28 AM5/8/20
to cmtk-users
Hi Sebastien, hi Pavan,

thank you for your help. Unfortunately, changing the location of the licencse file did not solve the problem. I have attached the recon-all log now.

I also tried to run the multi-scale brain parcellator with my precomputed Freesurfer output, but this also produced some errors regarding the jacobian file:

200506-14:23:21,579 nipype.interface INFO:
       > Compute and save jacobian
200506-14:23:21,581 nipype.interface INFO:
         ... Command: CreateJacobianDeterminantImage 3 "/output_dir/nipype/sub-01/anatomical_pipeline/parcellation_stage/parcThal/T1_Ind2temp1Warp.nii.gz" "/output_dir/nipype/sub-01/anatomical_pipeline/parcellation_stage/parcThal/T1_class-thalamus_probtissue_jacobian.nii.gz"
200506-14:23:21,843 nipype.interface INFO:
     terminate called after throwing an instance of 'itk::ImageFileReaderException'
  what():  /opt/conda/envs/py27msbparc/include/ITK-4.13/itkImageFileReader.hxx:143:
 Could not create IO object for reading file /output_dir/nipype/sub-01/anatomical_pipeline/parcellation_stage/parcThal/T1_Ind2temp1Warp.nii.gz
The file doesn't exist.
Filename = /output_dir/nipype/sub-01/anatomical_pipeline/parcellation_stage/parcThal/T1_Ind2temp1Warp.nii.gz 
Aborted
.....
  File "/opt/conda/envs/py27msbparc/lib/python2.7/site-packages/cmtklib/parcellation.py", line 1383, in _run_interface
    Ij = ni.load(jacobian_file).get_data()    # numpy.ndarray
  File "/opt/conda/envs/py27msbparc/lib/python2.7/site-packages/nibabel/loadsave.py", line 42, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
nibabel.py3k.FileNotFoundError: No such file or no access: '/output_dir/nipype/sub-01/anatomical_pipeline/parcellation_stage/parcThal/T1_class-thalamus_probtissue_jacobian.nii.gz'

I also attached the crash log for this process - no Lausanne atlases were created.

Thank you for your help,
David




recon-all.log
crash_log_precomputed_freesurfer_output.txt
Reply all
Reply to author
Forward
0 new messages