Re: multiscalebrainparcellator error locating freesurfer license

37 views
Skip to first unread message

Sebastien Tourbier

unread,
Jan 15, 2020, 6:08:42 AM1/15/20
to cmtk-...@googlegroups.com
Hi Ariana!

What about if you try to call multiscalebrainparcellator with following command:

docker run -it --rm \
-v $parent_dir:/bids_dir \
-v $out_dir:/output_dir \
sebastientourbier/multiscalebrainparcellator \
/bids_dir /output_dir participant --participant_label 01 \
--isotropic_resolution 1.0 \
--skip_bids_validator


On Tue, Jan 14, 2020 at 8:12 PM Ariana Familiar <af...@sas.upenn.edu> wrote:
Hello! I'm attempting to run a single subject analysis with the following command:

docker run -it --rm \
-v $parent_dir:/bids_dir \
-v $out_dir:/output_dir \
-v $FREESURFER_HOME/license.txt:/bids_dir/code/license.txt \
sebastientourbier/multiscalebrainparcellator \
/bids_dir /output_dir participant --participant_label 01 \
--isotropic_resolution 1.0 \
--skip_bids_validator

However I'm getting the following error:

Standard error:
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer/license.txt not found.
  If you are outside the NMR-Martinos Center,
  go to http://surfer.nmr.mgh.harvard.edu/registration.html to 
  get a valid license file (it's free).
  If you are inside the NMR-Martinos Center,
  make sure to source the standard environment.
  A path to an alternative license file can also be
  specified with the FS_LICENSE environmental variable.
--------------------------------------------------------------------------
Return code: 255

The license.txt file is definitely in $FREESURFER_HOME  & in  /bids_dir/code so I'm not sure why it's not being located. I also manually made a directory /opt/freesurfer and copied the license file there but that did nothing.

I tried setting the FS_LICENSE environment variable but that did not fix it either.

Also receive an error when I use the argument in the command (even though I installed the latest version today so not sure why this argument doesn't work):

usage: multiscalebrainparcellator_bidsapp_entrypointscript [-h]

                                                           [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]

                                                           [--number_of_cores NUMBER_OF_CORES]

                                                           [--isotropic_resolution ISOTROPIC_RESOLUTION]

                                                           [--thalamic_nuclei]

                                                           [--hippocampal_subfields]

                                                           [--brainstem_structures]

                                                           [--skip_bids_validator]

                                                           [-v]

                                                           bids_dir output_dir

                                                           {participant}

multiscalebrainparcellator_bidsapp_entrypointscript: error: unrecognized arguments: --fs_license /Applications/freesurfer/license.txt




How can I fix this issue?



Here is the full output when I run the original command:



BIDS dataset: /bids_dir

WARNING: the specified number of cores (None) should be greater to 0

INFO: Maximal number of cores set to the maximal number of available cores (4)

Custom isotropic resolution for resampling: 1.0

Session structured dataset: False

Subjects to be analyzed: ['sub-01']

<cmp.multiscalebrainparcellator.pipelines.anatomical.anatomical.AnatomicalPipeline object at 0x7f3f69834b30>

Refresh folder WITHOUT session

INFO: New project with newly created (or overwritten) configuration file

WARNING: Configuration file  overwritten !

Config file (anat) saved as /bids_dir/derivatives/sub-01_anatomical_config.ini

Config file (anat) saved as /bids_dir/derivatives/sub-01_anatomical_config.ini

Processing command:

multiscalebrainparcellator /bids_dir /output_dir sub-01 /bids_dir/derivatives/sub-01_anatomical_config.ini

###################################################################


Multi-scale Brain Parcellator 1.0.0-beta

Copyright (C) 2017-2019, Brain Communication Pathways Sinergia Consortium, Switzerland

             All rights reserved.


###################################################################

/opt/conda/lib/python2.7/site-packages/grabbit/core.py:410: UserWarning: No valid root directory found for domain 'derivatives'. Falling back on the Layout's root directory. If this isn't the intended behavior, make sure the config file for this domain includes a 'root' key.

  "'root' key." % config['name'])

No session

<cmp.multiscalebrainparcellator.pipelines.anatomical.anatomical.AnatomicalPipeline object at 0x7fcc8e3af470>

Refresh folder WITHOUT session

INFO: Existing project... Loading configuration file /bids_dir/derivatives/sub-01_anatomical_config.ini

[u'sub-01']

**** Check Inputs  ****

/bids_dir/derivatives/cmp/sub-01/anat/sub-01_T1w.nii.gz

Looking in /bids_dir for....

T1_file : /bids_dir/derivatives/cmp/sub-01/anat/sub-01_T1w.nii.gz

T1w available

Inputs check finished successfully. 

Only anatomical data (T1) available.

parcellation_stage

/output_dir/cmp/sub-01/tmp/anatomical_pipeline/parcellation_stage

segmentation_stage

/output_dir/cmp/sub-01/tmp/anatomical_pipeline/segmentation_stage

200114-18:54:13,172 nipype.interface INFO:

**** Processing ****

Freesurfer_subjects_dir: /output_dir/freesurfer

Freesurfer_subject_id: /output_dir/freesurfer/sub-01

200114-18:54:13,850 nipype.workflow INFO:

Generated workflow graph: /output_dir/cmp/sub-01/tmp/anatomical_pipeline/graph.svg (graph2use=colored, simple_form=True).

Number of cores used: 1

200114-18:54:13,972 nipype.workflow INFO:

Workflow anatomical_pipeline settings: ['check', 'execution', 'logging', 'monitoring']

200114-18:54:14,36 nipype.workflow INFO:

Running serially.

200114-18:54:14,38 nipype.workflow INFO:

[Node] Setting-up "anatomical_pipeline.datasource" in "/output_dir/cmp/sub-01/tmp/anatomical_pipeline/datasource".

200114-18:54:14,91 nipype.workflow INFO:

[Node] Running "datasource" ("nipype.interfaces.io.DataGrabber")

200114-18:54:14,137 nipype.workflow INFO:

[Node] Finished "anatomical_pipeline.datasource".

200114-18:54:14,141 nipype.workflow INFO:

[Node] Setting-up "anatomical_pipeline.segmentation_stage.mgz_convert" in "/output_dir/cmp/sub-01/tmp/anatomical_pipeline/segmentation_stage/mgz_convert".

T1 is available

200114-18:54:14,197 nipype.workflow INFO:

[Node] Running "mgz_convert" ("nipype.interfaces.freesurfer.preprocess.MRIConvert"), a CommandLine Interface with command:

mri_convert --out_type mgz --resample_type interpolate -voxsize 1.000000 1.000000 1.000000 --input_volume /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz --output_volume T1.mgz

200114-18:54:14,682 nipype.interface INFO:

stdout 2020-01-14T18:54:14.681884:mri_convert.bin --out_type mgz --resample_type interpolate -voxsize 1.000000 1.000000 1.000000 --input_volume /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz --output_volume T1.mgz 

200114-18:54:14,685 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:--------------------------------------------------------------------------

200114-18:54:14,686 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:ERROR: FreeSurfer license file /opt/freesurfer/license.txt not found.

200114-18:54:14,687 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:  If you are outside the NMR-Martinos Center,

200114-18:54:14,688 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:  go to http://surfer.nmr.mgh.harvard.edu/registration.html to 

200114-18:54:14,689 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:  get a valid license file (it's free).

200114-18:54:14,691 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:  If you are inside the NMR-Martinos Center,

200114-18:54:14,692 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:  make sure to source the standard environment.

200114-18:54:14,693 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:  A path to an alternative license file can also be

200114-18:54:14,694 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:  specified with the FS_LICENSE environmental variable.

200114-18:54:14,695 nipype.interface INFO:

stderr 2020-01-14T18:54:14.685078:--------------------------------------------------------------------------

200114-18:54:14,697 nipype.interface INFO:

stdout 2020-01-14T18:54:14.697111:$Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $

200114-18:54:14,698 nipype.interface INFO:

stdout 2020-01-14T18:54:14.697111:reading from /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz...

200114-18:54:14,745 nipype.workflow WARNING:

[Node] Error on "anatomical_pipeline.segmentation_stage.mgz_convert" (/output_dir/cmp/sub-01/tmp/anatomical_pipeline/segmentation_stage/mgz_convert)

200114-18:54:14,771 nipype.workflow ERROR:

Node mgz_convert failed to run on host 9585ae7d354f.

200114-18:54:14,774 nipype.workflow ERROR:

Saving crash info to /app/crash-20200114-185414-root-mgz_convert-045cac55-bcfe-45e0-857f-0c6f4f6e0d6b.txt

Traceback (most recent call last):

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/plugins/linear.py", line 44, in run

    node.run(updatehash=updatehash)

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 473, in run

    result = self._run_interface(execute=True)

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 557, in _run_interface

    return self._run_command(execute)

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 637, in _run_command

    result = self._interface.run(cwd=outdir)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/freesurfer/base.py", line 144, in run

    return super(FSCommand, self).run(**inputs)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/base/core.py", line 511, in run

    runtime = self._run_interface(runtime)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/base/core.py", line 898, in _run_interface

    self.raise_exception(runtime)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/base/core.py", line 835, in raise_exception

    ).format(**runtime.dictcopy()))

RuntimeError: Command:

mri_convert --out_type mgz --resample_type interpolate -voxsize 1.000000 1.000000 1.000000 --input_volume /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz --output_volume T1.mgz

Standard output:

mri_convert.bin --out_type mgz --resample_type interpolate -voxsize 1.000000 1.000000 1.000000 --input_volume /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz --output_volume T1.mgz 

$Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $

reading from /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz...

Standard error:

--------------------------------------------------------------------------

ERROR: FreeSurfer license file /opt/freesurfer/license.txt not found.

  If you are outside the NMR-Martinos Center,

  go to http://surfer.nmr.mgh.harvard.edu/registration.html to 

  get a valid license file (it's free).

  If you are inside the NMR-Martinos Center,

  make sure to source the standard environment.

  A path to an alternative license file can also be

  specified with the FS_LICENSE environmental variable.

--------------------------------------------------------------------------

Return code: 255


Traceback (most recent call last):

  File "/opt/conda/bin/multiscalebrainparcellator", line 102, in <module>

    anat_pipeline.process()

  File "/opt/conda/lib/python2.7/site-packages/cmp/multiscalebrainparcellator/pipelines/anatomical/anatomical.py", line 464, in process

    anat_flow.run()

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/engine/workflows.py", line 597, in run

    runner.run(execgraph, updatehash=updatehash, config=self.config)

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/plugins/linear.py", line 44, in run

    node.run(updatehash=updatehash)

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 473, in run

    result = self._run_interface(execute=True)

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 557, in _run_interface

    return self._run_command(execute)

  File "/opt/conda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 637, in _run_command

    result = self._interface.run(cwd=outdir)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/freesurfer/base.py", line 144, in run

    return super(FSCommand, self).run(**inputs)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/base/core.py", line 511, in run

    runtime = self._run_interface(runtime)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/base/core.py", line 898, in _run_interface

    self.raise_exception(runtime)

  File "/opt/conda/lib/python2.7/site-packages/nipype/interfaces/base/core.py", line 835, in raise_exception

    ).format(**runtime.dictcopy()))

RuntimeError: Command:

mri_convert --out_type mgz --resample_type interpolate -voxsize 1.000000 1.000000 1.000000 --input_volume /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz --output_volume T1.mgz

Standard output:

mri_convert.bin --out_type mgz --resample_type interpolate -voxsize 1.000000 1.000000 1.000000 --input_volume /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz --output_volume T1.mgz 

$Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $

reading from /output_dir/cmp/sub-01/anat/sub-01_T1w.nii.gz...

Standard error:

--------------------------------------------------------------------------

ERROR: FreeSurfer license file /opt/freesurfer/license.txt not found.

  If you are outside the NMR-Martinos Center,

  go to http://surfer.nmr.mgh.harvard.edu/registration.html to 

  get a valid license file (it's free).

  If you are inside the NMR-Martinos Center,

  make sure to source the standard environment.

  A path to an alternative license file can also be

  specified with the FS_LICENSE environmental variable.

--------------------------------------------------------------------------

Return code: 255

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

--
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/45b68b34-7d24-4881-9ed2-93cb7c43830f%40googlegroups.com.

Ariana Familiar

unread,
Jan 15, 2020, 9:28:25 AM1/15/20
to cmtk-users
Thanks! It worked with the following:

docker run -it --rm \
-v $parent_dir:/bids_dir \
-v $out_dir:/output_dir \
-v $FREESURFER_HOME/license.txt:/bids_dir/code/license.txt \
-v $FREESURFER_HOME/license.txt:/opt/freesurfer/license.txt \
To unsubscribe from this group and stop receiving emails from it, send an email to cmtk-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages