Unable to specify existing FreeSurfer directories for multiple subjects in ref_anatomical_config.ini

23 views
Skip to first unread message

Yuta Katsumi

unread,
Feb 26, 2021, 3:09:56 PMFeb 26
to cmtk-users
Hi Sebastian,

I'm trying to run the anatomical pipeline on a large number of subjects in parallel. My goal is to create the Lausanne parcellations based on the FreeSurfer recon files I've already generated outside the BIDS app. The ref_anatomical_config.ini file looks like the following:

[Global]
process_type = anatomical
subjects = ['sub-100206', 'sub-100307', 'sub-100408', ... , 'sub-995174', 'sub-996782']
subject = sub-01
subject_session =

[segmentation_stage]
seg_tool = Freesurfer
make_isotropic = False
isotropic_vox_size = 1.2
isotropic_interpolation = cubic
brain_mask_extraction_tool = Freesurfer
ants_templatefile =
ants_probmaskfile =
ants_regmaskfile =
use_fsl_brain_mask = False
brain_mask_path =
use_existing_freesurfer_data = True
freesurfer_subjects_dir = /output_dir/freesurfer
freesurfer_subject_id =
freesurfer_args =
white_matter_mask =
number_of_threads = 4

My question specifically concerns how to specify the "freesurfer_subject_id" field. If I'm running this on a single subject, I can just specify their subject ID (i.e., freesurfer_subject_id = 'sub-100206') and the pipeline runs just fine. However, I can't seem to specify this variable correctly for multiple subjects. So far, I've tried the following, but none of them worked (the BIDS app errors out as it can't find the FreeSurfer derivatives):

- listing all subjects in square brackets (as in "subjects" variable above)
- listing all subjects without brackets, single quotes, or commas
-"sub-01"
-getting rid of the field entirely

Could you let me know how to correctly specify this field when running multiple subjects concurrently? I'm seeing this error when running the BIDS app via SIngularity on CentOS and via Docker on MacOC so am assuming this is not specifically related to how I'm running the app.

Thanks,
Yuta

Sebastien Tourbier

unread,
Mar 1, 2021, 8:16:09 AMMar 1
to cmtk-users
Hi Yuta!

This field is a parameter of the segmentation stage which should not be set manually but will be set at execution. Also the field use_existing_freesurfer_data should be set to False. This comes from the CMP2 but now with BIDS CMP3 detect it automatically in output/dir/freesurfer organized as follows:

output/dir/freesurfer
    |_ sub-100206
        |_ mri
        |_ label
        |_ surf
        |_ ...
    |_ sub-100307
        |_ mri
        |_ label
        |_ surf
        |_ ...
    |_ ...

Does it work if you change the following lines in the configuration file:

use_existing_freesurfer_data = False
freesurfer_subjects_dir =
freesurfer_subject_id =

?

If not, please you could provide me with more details such as the CMP3 version you are using and more importantly the error message you get in the terminal ?

Sebastien

Yuta Katsumi

unread,
Mar 2, 2021, 2:46:03 PMMar 2
to cmtk-users
Hi Sebastien,

Thanks so much for your input! I changed the lines in the configuration file exactly as you suggested, but am unfortunately running into additional issues.

Looking at the log file, it seems that CMP3 is actually trying to run recon-all, which suggests to me perhaps that it failed to recognize the existing FreeSurfer derivatives. This recon-all call, however, crashes prematurely due to an error related to Perl. I'm pasting below the full contents of a log file for one subject for illustration. I'm also including the output shown in the terminal, although there is no error displayed there. I'm using v3.0.0-RC3. I'm experiencing these issues both on a macOS v10.14.5 (via Docker) and on CentOS7 (via a singularity version of the same image).

Thanks,
Yuta

<Log file>
Connectome Mapper v3.0.0-RC3
Copyright (C) 2009-2021, Ecole Polytechnique Federale de Lausanne (EPFL)
                the University Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland,
& Contributors

                All rights reserved.

INFO : No detected session
>> Load anatomical config file : /output_dir/cmp/sub-100206/sub-100206_anatomical_config.ini
**** Check Inputs  ****
> Looking in /bids_dir for....
/bids_dir/sub-100206/anat/sub-100206_run-01_T1w.nii.gz
... t1_file : /bids_dir/sub-100206/anat/sub-100206_run-01_T1w.nii.gz
/bids_dir/sub-100206/anat/sub-100206_run-01_T1w.json
... t1_json_file : /bids_dir/sub-100206/anat/sub-100206_run-01_T1w.json
Inputs check finished successfully.
Only anatomical data (T1) available.
--- Set Freesurfer and ANTs to use 1 threads by the means of OpenMP
210302-15:40:47,503 nipype.interface INFO:
     **** Processing ****
Freesurfer_subjects_dir: /output_dir/freesurfer
Freesurfer_subject_id: /output_dir/freesurfer/sub-100206
210302-15:40:49,725 nipype.workflow INFO:
     Generated workflow graph: /output_dir/nipype/sub-100206/anatomical_pipeline/graph.svg (graph2use=colored, simple_form=True).
210302-15:40:49,940 nipype.workflow INFO:
     Workflow anatomical_pipeline settings: ['check', 'execution', 'logging', 'monitoring']
210302-15:40:50,77 nipype.workflow INFO:
     Running serially.
210302-15:40:50,82 nipype.workflow INFO:
     [Node] Setting-up "anatomical_pipeline.datasource" in "/output_dir/nipype/sub-100206/anatomical_pipeline/datasource".
210302-15:40:50,284 nipype.workflow INFO:
     [Node] Running "datasource" ("nipype.interfaces.io.DataGrabber")
210302-15:40:50,352 nipype.workflow INFO:
     [Node] Finished "anatomical_pipeline.datasource".
210302-15:40:50,356 nipype.workflow INFO:
     [Node] Setting-up "anatomical_pipeline.segmentation_stage.mgzConvert" in "/output_dir/nipype/sub-100206/anatomical_pipeline/segmentation_stage/mgzConvert".
210302-15:40:50,414 nipype.workflow INFO:
     [Node] Cached "anatomical_pipeline.segmentation_stage.mgzConvert" - collecting precomputed outputs
210302-15:40:50,417 nipype.workflow INFO:
     [Node] "anatomical_pipeline.segmentation_stage.mgzConvert" found cached.
210302-15:40:50,420 nipype.workflow INFO:
     [Node] Setting-up "anatomical_pipeline.segmentation_stage.copyOrig" in "/output_dir/nipype/sub-100206/anatomical_pipeline/segmentation_stage/copyOrig".
210302-15:40:50,472 nipype.workflow INFO:
     [Node] Outdated cache found for "anatomical_pipeline.segmentation_stage.copyOrig".
210302-15:40:50,736 nipype.workflow INFO:
     [Node] Running "copyOrig" ("nipype.interfaces.utility.base.Rename")
210302-15:40:50,851 nipype.workflow INFO:
     [Node] Finished "anatomical_pipeline.segmentation_stage.copyOrig".
210302-15:40:50,856 nipype.workflow INFO:
     [Node] Setting-up "anatomical_pipeline.segmentation_stage.reconall" in "/output_dir/nipype/sub-100206/anatomical_pipeline/segmentation_stage/reconall".
210302-15:40:51,814 nipype.interface INFO:
     resume recon-all : recon-all -all  -no-isrunning -parallel -openmp 1 -subjid /output_dir/freesurfer/sub-100206 -sd /output_dir/freesurfer -nomotioncor -notalairach -nonuintensitycor -nonormalization -noskullstrip -nogcareg -nocanorm -nocareg -nocalabel -nonormalization2 -nomaskbfs -nosegmentation -nofill -notessellate -nosmooth1 -noinflate1 -noqsphere -nofix -nosmooth2 -noinflate2 -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortribbon
210302-15:40:51,907 nipype.workflow INFO:
     [Node] Running "reconall" ("nipype.interfaces.freesurfer.preprocess.ReconAll"), a CommandLine Interface with command:
recon-all -all  -no-isrunning -parallel -openmp 1 -subjid /output_dir/freesurfer/sub-100206 -sd /output_dir/freesurfer -nomotioncor -notalairach -nonuintensitycor -nonormalization -noskullstrip -nogcareg -nocanorm -nocareg -nocalabel -nonormalization2 -nomaskbfs -nosegmentation -nofill -notessellate -nosmooth1 -noinflate1 -noqsphere -nofix -nosmooth2 -noinflate2 -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortribbon
210302-15:40:51,999 nipype.interface INFO:
     resume recon-all : recon-all -all  -no-isrunning -parallel -openmp 1 -subjid /output_dir/freesurfer/sub-100206 -sd /output_dir/freesurfer -nomotioncor -notalairach -nonuintensitycor -nonormalization -noskullstrip -nogcareg -nocanorm -nocareg -nocalabel -nonormalization2 -nomaskbfs -nosegmentation -nofill -notessellate -nosmooth1 -noinflate1 -noqsphere -nofix -nosmooth2 -noinflate2 -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortribbon
210302-15:40:52,417 nipype.interface INFO:
     stdout 2021-03-02T15:40:52.417202:Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
210302-15:40:52,421 nipype.interface INFO:
     stdout 2021-03-02T15:40:52.417202:Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
210302-15:40:52,484 nipype.interface INFO:
     stdout 2021-03-02T15:40:52.484594:INFO: SUBJECTS_DIR is /output_dir/freesurfer
210302-15:40:52,490 nipype.interface INFO:
     stdout 2021-03-02T15:40:52.490654:Actual FREESURFER_HOME /opt/freesurfer
210302-15:40:52,667 nipype.interface INFO:
     stdout 2021-03-02T15:40:52.667158:-rwxrwxrwx 1 503 dialout 416822 Mar  2 15:32 /output_dir/freesurfer/sub-100206/scripts/recon-all.log
210302-15:40:52,714 nipype.interface INFO:
     stdout 2021-03-02T15:40:52.714196:Linux 065c02599775 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
210302-15:40:52,908 nipype.interface INFO:
     stderr 2021-03-02T15:40:52.908065:Can't locate Sys/Hostname.pm in @INC (you may need to install the Sys::Hostname module) (@INC contains: /opt/freesurfer/mni/lib/perl5/5.8.5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
210302-15:40:52,912 nipype.interface INFO:
     stderr 2021-03-02T15:40:52.908065:BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
210302-15:40:52,915 nipype.interface INFO:
     stderr 2021-03-02T15:40:52.908065:Compilation failed in require at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
210302-15:40:52,918 nipype.interface INFO:
     stderr 2021-03-02T15:40:52.908065:BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
210302-15:40:52,926 nipype.interface INFO:
     stderr 2021-03-02T15:40:52.908065:Compilation failed in require at /opt/freesurfer/mni/bin/nu_correct line 38.
210302-15:40:52,929 nipype.interface INFO:
     stderr 2021-03-02T15:40:52.908065:BEGIN failed--compilation aborted at /opt/freesurfer/mni/bin/nu_correct line 38.
210302-15:40:53,674 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.674913:'/opt/freesurfer/bin/recon-all' -> '/output_dir/freesurfer/sub-100206/scripts/recon-all.local-copy'
210302-15:40:53,702 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.702507:#--------------------------------------------
210302-15:40:53,720 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.720910:#@# Make White Surf lh Tue Mar  2 15:40:53 UTC 2021
210302-15:40:53,735 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.734976:/output_dir/freesurfer/sub-100206/scripts
210302-15:40:53,758 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.758118:
210302-15:40:53,762 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.758118: mris_make_surfaces -aseg ../mri/aseg.presurf -white white.preaparc -noaparc -mgz -T1 brain.finalsurfs sub-100206 lh
210302-15:40:53,765 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.758118:
210302-15:40:53,889 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.889729:#--------------------------------------------
210302-15:40:53,911 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.911058:#@# Make White Surf rh Tue Mar  2 15:40:53 UTC 2021
210302-15:40:53,921 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.921328:/output_dir/freesurfer/sub-100206/scripts
210302-15:40:53,945 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.945306:
210302-15:40:53,950 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.945306: mris_make_surfaces -aseg ../mri/aseg.presurf -white white.preaparc -noaparc -mgz -T1 brain.finalsurfs sub-100206 rh
210302-15:40:53,952 nipype.interface INFO:
     stdout 2021-03-02T15:40:53.945306:
210302-15:40:54,193 nipype.interface INFO:
     stdout 2021-03-02T15:40:54.193002:Waiting for PID 228 of (228 231) to complete...
210302-15:40:57,494 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.494358:Waiting for PID 231 of (228 231) to complete...
210302-15:40:57,525 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.525428:PIDs (228 231) completed and logs appended.
210302-15:40:57,551 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.551899:Linux 065c02599775 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
210302-15:40:57,561 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.561291:
210302-15:40:57,573 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.573205:recon-all -s sub-100206 exited with ERRORS at Tue Mar  2 15:40:57 UTC 2021
210302-15:40:57,582 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.582226:
210302-15:40:57,586 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.586519:For more details, see the log file /output_dir/freesurfer/sub-100206/scripts/recon-all.log
210302-15:40:57,593 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.593041:To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
210302-15:40:57,597 nipype.interface INFO:
     stdout 2021-03-02T15:40:57.597321:
210302-15:40:57,795 nipype.workflow WARNING:
     Storing result file without outputs
210302-15:40:57,832 nipype.workflow WARNING:
     [Node] Error on "anatomical_pipeline.segmentation_stage.reconall" (/output_dir/nipype/sub-100206/anatomical_pipeline/segmentation_stage/reconall)
210302-15:40:57,852 nipype.workflow ERROR:
     Node reconall failed to run on host 065c02599775.
210302-15:40:57,856 nipype.workflow ERROR:
     Saving crash info to /tmp/crash-20210302-154057-UID503-reconall-2e8c00f4-5740-4522-8ba4-18bf69cd0634.txt
Traceback (most recent call last):
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/plugins/linear.py", line 46, in run
    node.run(updatehash=updatehash)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 419, in run
    runtime = self._run_interface(runtime)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 814, in _run_interface
    self.raise_exception(runtime)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 745, in raise_exception
    ).format(**runtime.dictcopy())
RuntimeError: Command:
recon-all -all  -no-isrunning -parallel -openmp 1 -subjid /output_dir/freesurfer/sub-100206 -sd /output_dir/freesurfer -nomotioncor -notalairach -nonuintensitycor -nonormalization -noskullstrip -nogcareg -nocanorm -nocareg -nocalabel -nonormalization2 -nomaskbfs -nosegmentation -nofill -notessellate -nosmooth1 -noinflate1 -noqsphere -nofix -nosmooth2 -noinflate2 -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortribbon
Standard output:
Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
INFO: SUBJECTS_DIR is /output_dir/freesurfer
Actual FREESURFER_HOME /opt/freesurfer
-rwxrwxrwx 1 503 dialout 416822 Mar  2 15:32 /output_dir/freesurfer/sub-100206/scripts/recon-all.log
Linux 065c02599775 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
'/opt/freesurfer/bin/recon-all' -> '/output_dir/freesurfer/sub-100206/scripts/recon-all.local-copy'
#--------------------------------------------
#@# Make White Surf lh Tue Mar  2 15:40:53 UTC 2021
/output_dir/freesurfer/sub-100206/scripts

 mris_make_surfaces -aseg ../mri/aseg.presurf -white white.preaparc -noaparc -mgz -T1 brain.finalsurfs sub-100206 lh

#--------------------------------------------
#@# Make White Surf rh Tue Mar  2 15:40:53 UTC 2021
/output_dir/freesurfer/sub-100206/scripts

 mris_make_surfaces -aseg ../mri/aseg.presurf -white white.preaparc -noaparc -mgz -T1 brain.finalsurfs sub-100206 rh

Waiting for PID 228 of (228 231) to complete...
Waiting for PID 231 of (228 231) to complete...
PIDs (228 231) completed and logs appended.
Linux 065c02599775 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

recon-all -s sub-100206 exited with ERRORS at Tue Mar  2 15:40:57 UTC 2021

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

Standard error:
Can't locate Sys/Hostname.pm in @INC (you may need to install the Sys::Hostname module) (@INC contains: /opt/freesurfer/mni/lib/perl5/5.8.5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
Compilation failed in require at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
Compilation failed in require at /opt/freesurfer/mni/bin/nu_correct line 38.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/bin/nu_correct line 38.
Return code: 1

Traceback (most recent call last):
  File "/opt/conda/envs/py37cmp-core/bin/connectomemapper3", line 159, in <module>
    anat_pipeline.process()
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/cmp/pipelines/anatomical/anatomical.py", line 909, in process
    anat_flow.run()
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/engine/workflows.py", line 632, in run
    runner.run(execgraph, updatehash=updatehash, config=self.config)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/plugins/linear.py", line 46, in run
    node.run(updatehash=updatehash)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 419, in run
    runtime = self._run_interface(runtime)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 814, in _run_interface
    self.raise_exception(runtime)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 745, in raise_exception
    ).format(**runtime.dictcopy())
RuntimeError: Command:
recon-all -all  -no-isrunning -parallel -openmp 1 -subjid /output_dir/freesurfer/sub-100206 -sd /output_dir/freesurfer -nomotioncor -notalairach -nonuintensitycor -nonormalization -noskullstrip -nogcareg -nocanorm -nocareg -nocalabel -nonormalization2 -nomaskbfs -nosegmentation -nofill -notessellate -nosmooth1 -noinflate1 -noqsphere -nofix -nosmooth2 -noinflate2 -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortribbon
Standard output:
Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
INFO: SUBJECTS_DIR is /output_dir/freesurfer
Actual FREESURFER_HOME /opt/freesurfer
-rwxrwxrwx 1 503 dialout 416822 Mar  2 15:32 /output_dir/freesurfer/sub-100206/scripts/recon-all.log
Linux 065c02599775 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
'/opt/freesurfer/bin/recon-all' -> '/output_dir/freesurfer/sub-100206/scripts/recon-all.local-copy'
#--------------------------------------------
#@# Make White Surf lh Tue Mar  2 15:40:53 UTC 2021
/output_dir/freesurfer/sub-100206/scripts

 mris_make_surfaces -aseg ../mri/aseg.presurf -white white.preaparc -noaparc -mgz -T1 brain.finalsurfs sub-100206 lh

#--------------------------------------------
#@# Make White Surf rh Tue Mar  2 15:40:53 UTC 2021
/output_dir/freesurfer/sub-100206/scripts

 mris_make_surfaces -aseg ../mri/aseg.presurf -white white.preaparc -noaparc -mgz -T1 brain.finalsurfs sub-100206 rh

Waiting for PID 228 of (228 231) to complete...
Waiting for PID 231 of (228 231) to complete...
PIDs (228 231) completed and logs appended.
Linux 065c02599775 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

recon-all -s sub-100206 exited with ERRORS at Tue Mar  2 15:40:57 UTC 2021

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

Standard error:
Can't locate Sys/Hostname.pm in @INC (you may need to install the Sys::Hostname module) (@INC contains: /opt/freesurfer/mni/lib/perl5/5.8.5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
Compilation failed in require at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
Compilation failed in require at /opt/freesurfer/mni/bin/nu_correct line 38.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/bin/nu_correct line 38.
Return code: 1

<terminal output>
Start BIDS App
> FreeSurfer license copy skipped as it already exists(BIDS App Manager)
> Datalad available: True
... BIDS App execution command: ['docker', 'run', '-it', '--rm', '-v', '/Volumes/Drax/HCP/bids:/bids_dir', '-v', '/Volumes/Drax/HCP/bids/derivatives:/output_dir', '-v', '/Applications/freesurfer/license.txt:/bids_dir/code/license.txt', '-v', '/Volumes/Drax/HCP/bids/code/ref_anatomical_config.ini:/code/ref_anatomical_config.ini', '-u', '503:20', 'sebastientourbier/connectomemapper-bidsapp:v3.0.0-RC3', '/bids_dir', '/output_dir', 'participant', '--participant_label', '100206', '--anat_pipeline_config', '/code/ref_anatomical_config.ini', '--fs_license', '/bids_dir/code/license.txt', '--number_of_participants_processed_in_parallel', '1', '--number_of_threads', '1']
> BIDS dataset: /bids_dir
> Subjects to analyze : ['100206']
> Set $FS_LICENSE which points to FreeSurfer license location (BIDS App)
  ... $FS_LICENSE : /bids_dir/code/license.txt
  * Number of subjects to be processed in parallel set to 1 (Total of cores available: 1)
  * Number of parallel threads set to 1 (total of cores: 1)
Report execution to Google Analytics.
Thanks to support us in the task of finding new funds for CMP3 development!
> Process subject sub-100206
WARNING: rewriting config file /output_dir/cmp/sub-100206/sub-100206_anatomical_config.ini
... Anatomical config created : /output_dir/cmp/sub-100206/sub-100206_anatomical_config.ini
... Running pipelines :
        - Anatomical MRI (segmentation and parcellation)
INFO: diffusion pipeline not performed
INFO: functional pipeline not performed
... cmd : connectomemapper3 --bids_dir /bids_dir --output_dir /output_dir --participant_label sub-100206 --anat_pipeline_config /output_dir/cmp/sub-100206/sub-100206_anatomical_config.ini --number_of_threads 1
> Clean docker image cache stored in /tmp
Processing with BIDS App Finished

Sebastien Tourbier

unread,
Mar 3, 2021, 8:15:33 AMMar 3
to cmtk-users
Hi Yuta!

It seems to have indeed worked!

You can see that these 2 attributes are well set at the beginning of the log:

     **** Processing ****
Freesurfer_subjects_dir: /output_dir/freesurfer
Freesurfer_subject_id: /output_dir/freesurfer/sub-100206

Also as you can see in the log, recon-all run in resume mode:

210302-15:40:51,814 nipype.interface INFO:
     resume recon-all : recon-all -all  -no-isrunning -parallel -openmp 1 -subjid /output_dir/freesurfer/sub-100206 -sd /output_dir/freesurfer -nomotioncor -notalairach -nonuintensitycor -nonormalization -noskullstrip -nogcareg -nocanorm -nocareg -nocalabel -nonormalization2 -nomaskbfs -nosegmentation -nofill -notessellate -nosmooth1 -noinflate1 -noqsphere -nofix -nosmooth2 -noinflate2 -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortribbon

But even if Freesurfer outputs are already available and Freesurfer see them, I already experienced that recon-all decided to reperform a few steps (not the whole) - this might related to the options generated by the nipype interface; but this should not take more than 30min.

Now, you have got into another issue and it seems you might have found a bug!
Based on the error:

Can't locate Sys/Hostname.pm in @INC (you may need to install the Sys::Hostname module) (@INC contains: /opt/freesurfer/mni/lib/perl5/5.8.5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/MiscUtilities.pm line 36.
Compilation failed in require at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/lib/perl5/5.8.5/MNI/Spawn.pm line 35.
Compilation failed in require at /opt/freesurfer/mni/bin/nu_correct line 38.
BEGIN failed--compilation aborted at /opt/freesurfer/mni/bin/nu_correct line 38.
Return code: 1

It is a message related to not having the program perl installed.
I am going to fix it in the upcoming release but in the meantime, the fastest way to get things working would be to edit the Dockerfile used to build the Docker image and then build the Docker image on your side.

To do so:

* Go to the clone repository folder:

  $ cd /path/to/connectomemapper

* Here you could find the Dockerfile, open it with your favorite text editor and update it with the following to install "perl":
 
  # Install system library dependencies
RUN apt-get update && \
apt-get install python2.7 python2.7-minimal software-properties-common -y && \
apt-get install -qq -y --no-install-recommends bc \
locales libstdc++6 npm curl perl bzip2 xvfb liblzma-dev locate exfat-fuse exfat-utils default-jre && \
curl -sSL http://neuro.debian.net/lists/xenial.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \
apt-key add /root/.neurodebian.gpg && \
(apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true) && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
apt-get update && \
apt-get clean && \
apt-get remove -y curl && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

* Then, build the docker image with the script "build_bidsapp.sh" as follows:

  $ sh build_bidsapp.sh

Hope this helps and thanks for your report !
Sebastien
Reply all
Reply to author
Forward
0 new messages