Unable to run FreeSurfer thalamic nuclei segmentation after FastSurfer without recon-all

Summary of what happened:

Hello everyone,

I am encountering persistent issues while trying to run thalamic nuclei segmentation using FreeSurfer 7.4.1 in a Singularity container after running FastSurfer.

I have successfully run FastSurfer, which completed the segmentation. Here’s the output structure:

subject1/
├── mri/
│   ├── aparc.DKTatlas+aseg.deep.mgz
│   ├── aseg.auto_noCCseg.mgz
│   ├── atlas_registered.nii.gz
│   ├── cerebellum.CerebNet.nii.gz
│   ├── mask.mgz
│   ├── orig/
│   ├── orig.mgz
│   ├── orig_converted.nii.gz
│   ├── orig_nu.mgz
│   └── transform.mat
├── scripts/
│   └── deep-seg.log
└── stats/
    ├── aseg+DKT.stats
    └── cerebellum.CerebNet.stats

I am now trying to run the FreeSurfer thalamic nuclei segmentation without running recon-all, as I understand this should be possible directly on the FastSurfer output.

I have tried various approaches to resolve this issue, including:

  • Binding different directories
  • Setting LD_LIBRARY_PATH
  • Creating symbolic links

None of these attempts have been successful.

My questions are:

  1. Is there a known issue with running thalamic nuclei segmentation on FastSurfer output without recon-all?
  2. Are there any specific steps or workarounds for installing MCR in a read-only Singularity container when working with FastSurfer output?
  3. Is there an alternative method to run thalamic nuclei segmentation on FastSurfer output without relying on MCR?
  4. Are there any additional files or preprocessing steps needed for thalamic nuclei segmentation that might be missing from the FastSurfer output?
  5. Given that I have tried binding directories, setting LD_LIBRARY_PATH, and creating symbolic links without success, are there any other troubleshooting steps you’d recommend?

Any guidance or suggestions would be greatly appreciated. Thank you in advance for your help!

Command used (and if a helper script was used, a link to the helper script or the command generated):

singularity exec -B /path/to/fastsurfer/output:/data \
    -e \
    /path/to/freesurfer.sif \
    bash -c 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/freesurfer/MCRv97/runtime/glnxa64:/usr/local/freesurfer/MCRv97/bin/glnxa64:/usr/local/freesurfer/MCRv97/sys/os/glnxa64:/usr/local/freesurfer/MCRv97/extern/bin/glnxa64 && \
    export MCR_CACHE_ROOT=/path/to/mcr_cache && \
    segmentThalamicNuclei.sh \
    subject1 \
    /data/fastsurfer_output'

Version:

FreeSurfer version: 7.4.1 (freesurfer-linux-centos8_x86_64-7.4.1-20230613-7eb8460)

Environment (Docker, Singularity / Apptainer, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

When trying to run this command, I get an error indicating that the MATLAB Runtime (MCR) 2019b is not found.

I have attempted to install MCR using fs_install_mcr R2019b, but the installation fails with the following error:

mv: inter-device move failed: '/tmp/tmp.XXXXXXXX/install-target/v97' to '/usr/local/freesurfer/MCRv97'; unable to remove target: Read-only file system

Screenshots / relevant information:


Hi @aritban, and welcome to neurostars!

In the future, please use the Software Support post category and template for software related issues. You can see I relabeled and reorganized your post this time.

I believe the freesurfer container released by Neurodesk (neurocontainers/recipes/freesurfer at master · NeuroDesk/neurocontainers · GitHub) has FreeSurfer 7.4.1 with the MCR installed for thalamic nuclei segmentation tools. @stebo85 can you confirm that?

Best,
Steven

Yes, I can confirm that Neurodesk’s FreeSurfer container has the Thalamic segmentation setup and it should work - if not I can investigate :slight_smile: Can you test this quickly @aritban ?

curl -X GET https://neurocontainers.neurodesk.org/freesurfer_7.4.1_20231214.simg -O
singularity shell freesurfer_7.4.1_20231214.simg
segmentThalamicNuclei.sh sub-id

@stebo85 @Steven I just did, and it works smoothly! Thank you so much for your help!

1 Like

Great to hear :slight_smile: Thank you!