Giter Site home page Giter Site logo

mica-mni / micapipe Goto Github PK

View Code? Open in Web Editor NEW
77.0 4.0 27.0 364.39 MB

micapipe from the Multimodal imaging and connectome analysis lab (http://mica-mni.github.io) at the Montreal Neurological Institute. Read The Docs documentation below

Home Page: http://micapipe.readthedocs.io

License: GNU General Public License v3.0

Shell 59.81% Python 37.84% Dockerfile 2.34%
mri connectome multimodal imageprocessing bids neuroimaging microstructure resting-state diffusion-mri awesome

micapipe's People

Contributors

alexander-ngo avatar codacy-badger avatar janiedp avatar jordandekraker avatar neuroimagingdatascience avatar peerherholz avatar rcruces avatar reindervosdewael avatar royj23 avatar saratheriver avatar y0ungeunii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

micapipe's Issues

Incorrect bvalues returned with processed multishell sequence.

  • What is the current behavior? The final processed dwi in a multishell sequence has incorrect bvalues for 1st and 2nd shells. Original shells were 500, 1000, and 4000. "New" shells are 62, 250, and 4000.
  • Please provide the steps to reproduce and if possible a minimal demo of the problem Provide multishell acquisition and a reverse-PE b0 image. Confirm bvalues with mrinfo -dwgrad $file.
  • What is the expected behavior? Final processed output should preserve original bvalues.
  • Please tell us about your computing environment: Modified singularity container, running ubuntu 16.04 (xenial) and FS7.1.1.
  • Other information

Original bvals

0 500 500 500 500 500 500 500 500 500 500 500 501 500 500 500 1000 1000 1000 1000 1000 1000 1001 1000 1000 1001 1000 1001 1000 1001 1000 4000 4001 3999 3999 3999 3999 4002 4000 3999 4002 4002 4006 3998 4003 4001

Original bvecs

0.000 0.354 0.227 0.091 0.263 0.058 -0.281 0.269 -0.179 0.236 0.045 -0.063 0.090 -0.120 -0.283 0.119 0.500 0.322 0.129 0.372 0.082 -0.398 0.381 -0.253 0.334 0.064 -0.089 0.128 -0.170 -0.401 0.168 1.000 0.643 0.258 0.745 0.164 -0.796 0.761 -0.506 0.667 0.128 -0.178 0.255 -0.340 -0.801 0.336
0.000 0.000 0.271 0.109 -0.210 -0.179 -0.113 0.151 0.295 -0.056 -0.339 -0.317 -0.209 -0.260 0.116 0.015 0.000 0.383 0.153 -0.297 -0.254 -0.161 0.213 0.416 -0.079 -0.479 -0.449 -0.295 -0.368 0.165 0.021 0.000 0.766 0.307 -0.594 -0.507 -0.321 0.427 0.833 -0.158 -0.959 -0.898 -0.590 -0.736 0.329 0.043
0.000 0.000 0.000 0.324 0.107 0.299 0.181 0.173 0.079 0.257 0.090 -0.142 -0.271 0.207 0.177 -0.333 0.000 0.000 0.458 0.151 0.423 0.257 0.244 0.112 0.364 0.127 -0.202 -0.384 0.292 0.251 -0.470 0.000 0.000 0.916 0.303 0.846 0.513 0.489 0.224 0.728 0.254 -0.403 -0.767 0.585 0.501 -0.941

"New" bvals

0 62.658 62.485 62.56899999 62.35900001 62.403 62.2455 62.54550001 62.6535 62.4405 62.52299999 62.311 62.736222 62.4245 62.437 62.6375 250 250.373 249.814 249.394 250.169 250.374 250.316066 249.609 250.293 249.915666 250.326 251.115865 249.588 251.278027 249.565 4000 4001.820205 3998.476131 3997.68033 3997.644339 3998.304174 4004.285142 4000.404 3998.348163 4004.325162 4003.988994 4011.664484 3996.084958 4006.374529 4001.904226

Use existing freesurfer output from fmriprep or qsiprep

Freesurfer recon_all takes a long time to run, and occupies a fair bit of space. It'd be great if you could specify an existing freesurfer directory that micapipe could use. qsiprep and fmriprep both now implement this capability.

Issue with naming of str_dwi_affine/mat_dwi_affine not consistent between 02_proc-dwi.sh and 03_SC.sh

  • What is the current behavior?
    A change was made to 02_proc-dwi.sh in commit 29924fb but was not reflected in 03_SC.sh and causes problems.

In 02_proc-dwi.sh, this:
str_dwi_affine="${dir_warp}/${idBIDS}_space-dwi_from-dwi_to-nativepro_mode-image_desc-"
mat_dwi_affine="${str_dwi_affine}0GenericAffine.mat"

Was changed to:
str_dwi_affine="${dir_warp}/${idBIDS}_space-dwi_from-dwi_to-nativepro_mode-image_desc-affine_"
mat_dwi_affine="${str_dwi_affine}0GenericAffine.mat"

However, 03_SC.sh still looks for:
str_dwi_affine="${dir_warp}/${idBIDS}_space-dwi_from-dwi_to-nativepro_mode-image_desc-"
mat_dwi_affine="${str_dwi_affine}0GenericAffine.mat"

And throws an error at this line:
if [ ! -f "$mat_dwi_affine" ]; then Error "Subject $id doesn't have an affine mat from T1nativepro to DWI space:\n\t\tRUN -proc_dwi"; exit; fi

Because I have this file in my xmf/ directory:
sub-05423_space-dwi_from-dwi_to-nativepro_mode-image_desc-affine_0GenericAffine.mat

and not this one:
sub-05423_space-dwi_from-dwi_to-nativepro_mode-image_desc-0GenericAffine.mat

This prevents SC from running.

  • What is the expected behavior?
    I suppose that 03_SC.sh should look for:
    str_dwi_affine="${dir_warp}/${idBIDS}_space-dwi_from-dwi_to-nativepro_mode-image_desc-affine_"
    mat_dwi_affine="${str_dwi_affine}0GenericAffine.mat"

subject_QC: Sankey diagram of DWI appears to be incomplete (orange) but it's not

  • What is the current behavior?
    Even when the DWI was processed successfully, the Sankey diagram of DWI is orange (INCOMPLETE)

  • Please provide the steps to reproduce and if possible a minimal demo of the problem
    mica-pipe -QC_subj -sub -bids -out

  • What is the expected behavior?
    The color of the sankey diagram should be blue for a complete DWI process

Documentation recommends container, no container exists

  • What is the current behaviour?

Currently the documentation recommends installation via container:

https://micapipe.readthedocs.io/en/latest/#reproducibility:

To encourage reproducibility and robustness of investigations using micapipe, we provide a fully containerized version of the pipeline in the form of a Docker container. Step-by-step tutorials are provided for bare metal and containerized installations. We encourage users to use containerized versions, offered through Docker and Singularity, given the large number of software dependencies used by the pipeline to handle multiple MRI data modalities.

https://micapipe.readthedocs.io/en/latest/pages/01.install/index.html:

We offer three installation options for micapipe: two containerized versions (Docker and Singularity) as well as a bare-metal installation.

But no such container exists: the Docker instructions attempt to pull from an invalid source, and the Singularity instructions are a placeholder.

I'm not super-familiar with Docker in execution (I'm more familiar with Singularity), but here's what I get when I try to run the recommended Docker command on a fresh Ubuntu 20.04.1 system:

$ sudo docker pull MICA-MNI/micapipe:latest
invalid reference format: repository name must be lowercase

# In case it's only that the case is a problem:
$ sudo docker pull mica-mni/micapipe:latest
Error response from daemon: pull access denied for mica-mni/micapipe, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

# In case it's relevant:
$ docker --version
Docker version 20.10.6, build 370c289

Is it just that it's planned but no one's managed to get to it yet? I didn't see a Dockerfile in the repo or nearby in GitHub.

  • What is the motivation / use case for changing the behaviour?

(To make the documentation correct and the containers available.)

  • If relevant, please tell us about your computing environment:

(Probably not relevant, but, Singularity and RHEL 7.6, with SGE.)

  • Other information

(Happy to provide on request.)

Nilearn dependency doesn't exist?

I am testing micapipe in a sigularity container in a cluster grid.When I look at the logs in several steps (e.g dwi_proc) there are several error messages related to missing python dependencies such as nilearn. I clip an example of this error. Am I doing something wrong? how should I prevent/solve this error?

Thanks in advance

PD: Here is an example of the way I run the code. I followed the tutorial example of the sudemex_conn database depicted in the documentation

singularity run --cleanenv  -B /mnt:/mnt -H $PWD singularity/micapipe_29092021.simg \
 -bids /mnt/MD1200B/egarza/afajardo/sudmex_conn/ds003346-download -sub 010 \
 -out /mnt/MD1200B/egarza/afajardo/sudmex_conn -proc_structural -proc_freesurfer -post_structural \ 
-GD -Morphology \ 
-proc_dwi \
-dwi_main /mnt/MD1200B/egarza/afajardo/sudmex_conn/ds003346-download/sub-010/dwi/sub-010_dwi.nii.gz \  
-dwi_rpe  /mnt/MD1200B/egarza/afajardo/sudmex_conn/ds003346-download/sub-010/fmap/sub-010_dir-PA_run-01_epi.nii.gz -SC -proc_rsfmri \ 
-mainScanStr task-rest_bold \
 -fmri_rpe  /mnt/MD1200B/egarza/afajardo/sudmex_conn/ds003346-download/sub-010/fmap/sub-010_dir-PA_run-02_epi.nii.gz
-regress_WM_CSF \
-GSR \ 
-QC_subj |&  tee micapipe_prueba/prueba4_logs.txt  |& tee micapipe_prueba/prueba4_logs.txt \

image

adding task fmri stream / 3dDeconvolve / to micapipe

might be great to add a task fmri stream to micapipe at one point in early 2022. We discussed this with some of you already and it may be a slight variation of the already existing rest fmri stream, and perhaps include afni's 3dDeconvolve to get beta time series that would then be mapped to the surfaces (instead of / or in addition to the preprocessed task based time series). https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dDeconvolve.html

MPC surface ordering distorted

When running the micapipe container with the MPC module it appears that for some subjects and sessions my surface are not ordered correctly resulting in wrong lateralised correlation matrices, see the attached screenshots of the intensity profiles and resulting correlation matrices for two sessions of the same subject. This does not always happen in the same manner (i.e., the misordering of surfaces isn't consistent in the same way across subjects).

My suspicion is that the surfaces are not created in the proper temporal order (or at least something is failing in line 158 of 03_MPC.sh). Unfortunately as I am running the containerised default version all individual surface files are removed so I can't check that assumption without running the code step by step.

If there is an easy fix that could be plugged into the already run data (i.e., all freesufer and other registrations look totally fine and I would hate to rerun) then that would be much appreciated.

Screenshot 2022-08-23 at 11 53 17

'Subject 01 doesn't have T1_nativepro warp to MNI152.'

Hi - I am trying to run mica-pipe via Docker. It has completed 'proc_structural', but will not let me run 'proc_dwi' due to the following error:

rorypiper@MS00048528 mica-pipe-test % docker run -ti --rm
-v /Users/rorypiper/Desktop/mica-pipe-test/bids:/bids_dataset:ro
-v /Users/rorypiper/Desktop/mica-pipe-test/out:/output_directory
-v /Users/rorypiper/Desktop/mica-pipe-test/tmp:/tmp
-v /Applications/freesurfer/license.txt:/opt/freesurfer-6.0.0/freesurfer_license_file.txt
micalab/micapipe:latest
-out /output_directory
-sub 01
-bids /bids_dataset
-proc_dwi -ses 01
-nocleanup \

Some packages in this Docker container are non-free
If you are considering commercial use of this container, please consult the relevant license:
https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
INFO: /root/matlab/startup.m does not exist ... creating
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /opt/freesurfer-6.0.0
FSFAST_HOME /opt/freesurfer-6.0.0/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR /opt/freesurfer-6.0.0/subjects
MNI_DIR /opt/freesurfer-6.0.0/mni
FSL_DIR /opt/fsl-6.0.0


MICA pipeline - (Version v0.1.1 'Roadrunner') 
	Subject: 01 Session: ses-01

[ WARNING ]..... fix was not found, ICA-FIX will be skipped

[ INFO ]..... micapipe will use 6 threads for multicore processing

[ INFO ]..... Subject 01 directory exist

[ INFO ]..... Inputs of proc_dwi:
tmpDir : /tmp
dwi_main : DEFAULT
dwi_rpe : DEFAULT
rpe_all : FALSE
Affine only: FALSE
Processing : LOCAL

**-------------------------------------------------------------

[ ERROR ]..... Subject 01 doesn't have T1_nativepro warp to MNI152.
Run -proc_structural

-------------------------------------------------------------**

-proc_rsfmri states "couldn't find 001 main rsfMRI scan: ls"

I have been able to run the entire structural leg of the pipeline without issues, -proc_dwi without issues, (-SC not without issues) and I am now trying to run -proc_rsfmri

I am getting the error that the main rsfMRI scan cannot be found, even after manually specifying the scan via -MainScanStr. The file exists, and I have tried using both uncompressed (.nii) and compressed (.nii.gz) files.

I would expect the command to be able to at least find the scan, as it exists, e.g.:

image

I am running the pipeline through a singularity wrapper, on my university's computing cluster e.g.

$SINGULARITY_PULLFOLDER/micapipe_latest.sif -sub 001 -bids rawdata -out derivatives -ses 0

I am using MobaXterm as a terminal, and running this from a Windows computer.

Could anyone help me figure out what's going wrong here?

[ucjucrs@login12 dataset]$ $SINGULARITY_PULLFOLDER/micapipe_latest.sif -sub 001 -bids rawdata -out derivatives -ses 0 -proc_rsfmri -mainScanStr task-rest_run-1_bold.nii.gz
WARNING: Bind mount '/home/ucjucrs => /home/ucjucrs' overlaps container CWD /home/ucjucrs/Scratch/dataset, may not be available
Some packages in this Docker container are non-free
If you are considering commercial use of this container, please consult the relevant license:
https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /opt/freesurfer-6.0.0
FSFAST_HOME       /opt/freesurfer-6.0.0/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /opt/freesurfer-6.0.0/subjects
MNI_DIR           /opt/freesurfer-6.0.0/mni
FSL_DIR           /opt/fsl-6.0.0


-------------------------------------------------------------
        MICA pipeline - (Version v0.1.1 'Roadrunner')
                Subject: 001 Session: ses-0
-------------------------------------------------------------

[ WARNING ]..... fix was not found, ICA-FIX will be skipped

[ INFO ]..... micapipe will use 6 threads for multicore processing

[ INFO ]..... Subject 001 directory exist

[ INFO ]..... Inputs:
                Topup Config     :      DEFAULT
                ICA fix training :      DEFAULT
                Main scan        :      task-rest_run-1_bold.nii.gz
                Phase scan       :      DEFAULT
                Reverse Phase    :      DEFAULT
                Smoothing        :      0
                Perform NSR      :      0
                Perform GSR      :      0
                No FIX           :      0
                Longitudinal ses :      FALSE

[ INFO ]..... Using user provided main scan: /scratch/scratch/ucjucrs/dataset/rawdata/sub-001/ses-0/func/sub-001_ses-0_task-rest_run-1_bold.nii.gz

[ INFO ]..... No run number specified for phase reversals and did not find more than one phase reversal scan - all good!

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

[ ERROR ]..... Couldn't find 001 main rsfMRI scan :
         ls

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

Erasing temporal directory: /tmp/*_micapipe*_001
OLD_PATH is unset or empty


-------------------------------------------------------------
        GLOBAL micapipe running time with LOCAL processing: 0.017 minutes
-------------------------------------------------------------

Line 153 in 01_proc-struc_volumetric allows run_first_all to be prematurely terminated

Hi all,

I believe this conditional allows the code to advance & the file names to be changed before run_first_all is complete.

run_first_all does the following:
(1) calls first_flirt
(2) calls run_first & first_boundary_corr for each subcortical region
(3) calls fslmerge twice. Once to compile all the corr files into the 4D firstseg file, and again to compile all the first files into the 4D origsegs file.
(4) calls to first_mult_bcorr to convert firstseg into a 3D file with all subcortical segmentations together. This is the final version of firstseg that is later copied in line 115 of post_structural and eventually used to compute subcortical connectomes.
(5) calls to imrm to remove all of the individual segmentation files (corr & first)

The intermediate 4D version of firstseg created by the first call to fslmerge has the same name. This allows the code to advance prematurely and run_first_all to be interrupted before the final version is computed. At least on the BIC cluster this is happening.

Thanks for the great pipeline!
Mark

Freesurfer license not found

Hi,

I am running the conteinerized version of micapipe with singularity CE 3.5.3 in a cluster grid. It is worth noting that I pulled the container from the dockerhub : singularity pull micapipe.sif docker://micalab/micapipe:latest.

At some point of the freesurfer_proc crashes because the path to the license.txt file is missing (I clip a screenshot of the logs), and therefore all the subsequent steps fail. I have a freesurfer license but I don't know how to get it into the container. Is there a way to achieve this? Thanks in advance
image

Mica reports that it couldn't find any dwi file

  • What are you trying to do?
  • If you've tried running this with BrainSpace code already, how did you do so and what went wrong?
  • Please tell us about your computing environment:
  • Other information

Conte69 not generated from proc_structural

Hi MicaPipe team. Really excited to use this, but hit a problem with the output from the proc_sructural (and therefore cannot run the post_structural past step 3.

The proc_structural leaves me with an empty a Conte69 directory and therefore causes these issues in post_structural:

rorypiper @ MS00048528 Tue 15 Feb 2022 00:22:10 GMT:
COMMAND --> wb_command -surface-resample /tmp/790_micapipe_post-struct_sub-385_ses-01preop/rh.white.surf.gii /Users/rorypiper/Desktop/sub-385/ses-01preop/out/micapipe/sub-385/ses-01preop/anat/surfaces/conte69/sub-385_ses-01preop_rh_sphereReg.surf.gii /Users/rorypiper/Documents/software/micapipe/surfaces/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii BARYCENTRIC /Users/rorypiper/Desktop/sub-385/ses-01preop/out/micapipe/sub-385/ses-01preop/anat/surfaces/conte69/sub-385_ses-01preop_space-conte69-32k_desc-rh_white.surf.gii

While running:
/Applications/workbench/bin_macosx64/../macosx64_apps/wb_command.app/Contents/MacOS/wb_command -surface-resample /tmp/790_micapipe_post-struct_sub-385_ses-01preop/rh.white.surf.gii /Users/rorypiper/Desktop/sub-385/ses-01preop/out/micapipe/sub-385/ses-01preop/anat/surfaces/conte69/sub-385_ses-01preop_rh_sphereReg.surf.gii /Users/rorypiper/Documents/software/micapipe/surfaces/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii BARYCENTRIC /Users/rorypiper/Desktop/sub-385/ses-01preop/out/micapipe/sub-385/ses-01preop/anat/surfaces/conte69/sub-385_ses-01preop_space-conte69-32k_desc-rh_white.surf.gii

ERROR: NAME OF FILE: rh.white.surf.gii
PATH TO FILE: /tmp/790_micapipe_post-struct_sub-385_ses-01preop

File does not exist.


Please can you help?

02_proc-dwi.sh fails to find nifti_capture.py

  • What is the current behavior?
    The call to nifti_capture.py during dwi processing, in 02_proc-dwi.sh at lines 285 and 304 fails (file not found).

  • What is the expected behavior?
    Call to nifti_capture.py should run smoothly, which can probably be solved by adding the full path to this script, as this was done in release 0.1.1 for micapipe_qc:
    Do_cmd ${MICAPIPE}/functions/nifti_capture.py ...

MPC input

Hi all,
I have gotten everything to run except for the MPC stage. I am not sure what the input should be. I have a t1 weighted image, but no t2w.

The environment I'm using is Linux 16.04 LTS (xenial) with 24 processors.
Thanks,
Matt

Add wildcard to default lookup of -dwe_rpe scan?

  • What is the current behaviour?
  • If -dwi_rpe is not set, the default rpe scan is set by looking for:
    dwi_reverse=($(ls "${subject_bids}/dwi/${subject}${ses}"_dir-PA_*dwi.nii* 2>/dev/null))
    and thus excludes a _dir-PA_dwi scan with a acq label set before the dir label.
    (in functons/utilitise.sh at line 102)
  • What is the motivation / use case for changing the behaviour?
    Seems more flexible to add a wildcard *_dir-PA_*dwi.nii* and should not cause issues or errors down the road (although I might be wrong about that...)
    For instance my rpe scan is named sub-08027_acq-b0_dir-PA_dwi so -proc_dwi did not find it.

res-fMRI FC - missing ROI

  • What is the current behavior? I have generated FC matrices with micapipe (singularity). Some of them contain 450 rows (which is the correct number for Schaefer-400), yet some of them contain 449 rows. This appeared to be the case for 5 out of 66 sessions.
  • Please provide the steps to reproduce and if possible a minimal demo of the problem I have run Freesurfer recon-all first, then the rest of the analysis with micapipe.
  • What is the expected behavior? For instance, for Schaefer-400, there should 450 rows in the FC file.
  • Please tell us about your computing environment: HPC, singularity.
  • Other information

nilearn is not listed in Dependencies

  • What is the current behaviour?
    The python module nilearn is not listed with the Dependencies in the documentation, but it seems to be needed for -proc_dwi, seeing that I got the following message in the proc_dwi_*.e log file:
    Traceback (most recent call last): File "/fellows/fellows2/gabrielp/micapipe/functions/nifti_capture.py", line 33, in <module> from nilearn import plotting ModuleNotFoundError: No module named 'nilearn'
    It should be added to the list.

Final LUT Entry for Schaefer 1000?

Firstly, thank you all for creating this phenomenal resource! I'm excited to use it!

I was looking through the LUT files for the Schaefer parcellations, and I noticed that the final entry (1002) for the Schaefer-1000 atlas is missing. I also noticed that the penultimate entry was listed as the control network, which broke from the general pattern of having default network regions last.

Any clarification on these network labels here would be greatly appreciated!

Missing surface snapshots in QC report

  • What is the current behavior?
    Hi! Having some issues with the QC step.

I successfully ran these modules: -proc_structural, -proc_freesurfer, -post_structural, -GD, -Morphology, -proc_dwi

When I run -QC_subj, I am missing the following in my report:
1- the Freesurfer native surfaces in the -proc_freesurfer section.
2- the output parcellations and the conte69 surfaces in the -post_structural section.
3- the registration of T1w in DWI space in the -proc_dwi section.
4- the surfaces in the Cortical morphology section.

When I check the QC log , this error stood out:

 INFO ]..... Creating matrices and Sankey diagram ๏ฟฝ[0m
Loading required package: viridisLite

Attaching package: โ€˜viridisโ€™

The following object is masked from โ€˜package:scalesโ€™:

    viridis_pal

Error in library("plotly") : there is no package called โ€˜plotlyโ€™
Execution halted
๏ฟฝ[38;5;75m
[ INFO ]..... Create surface visualizations ๏ฟฝ[0m
๏ฟฝ[0m๏ฟฝ[31m2022-03-10 17:45:47.620 (   2.349s) [         2D806C0] vtkPythonAlgorithm.cxx:112    ERR| vtkPythonAlgorithm (0x4044235fc0): Failure when calling method: "ProcessRequest":๏ฟฝ[0m
๏ฟฝ[0m๏ฟฝ[31m2022-03-10 17:45:47.628 (   2.356s) [         2D806C0]       vtkExecutive.cxx:752    ERR| vtkCompositeDataPipeline (0x4042cb61c0): Algorithm vtkPythonAlgorithm(0x4044235fc0) returned failure for request: vtkInformation (0x4041f3fbe0)
  Debug: Off
  Modified Time: 174
  Reference Count: 2
  Registered Events: (none)
  Request: REQUEST_DATA
  FROM_OUTPUT_PORT: 0
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0

๏ฟฝ[0m
๏ฟฝ[0m๏ฟฝ[31m2022-03-10 17:45:47.635 (   2.363s) [         2D806C0] vtkPythonAlgorithm.cxx:112    ERR| vtkPythonAlgorithm (0x4043a68740): Failure when calling method: "ProcessRequest":๏ฟฝ[0m
๏ฟฝ[0m๏ฟฝ[31m2022-03-10 17:45:47.637 (   2.366s) [         2D806C0]       vtkExecutive.cxx:752    ERR| vtkCompositeDataPipeline (0x4041f31850): Algorithm vtkPythonAlgorithm(0x4043a68740) returned failure for request: vtkInformation (0x40458a3fc0)
  Debug: Off
  Modified Time: 306
  Reference Count: 2
  Registered Events: (none)
  Request: REQUEST_DATA
  FROM_OUTPUT_PORT: 0
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0

๏ฟฝ[0m
๏ฟฝ[0m๏ฟฝ[31m2022-03-10 17:45:57.786 (  12.514s) [         2D806C0]vtkXOpenGLRenderWindow.:448    ERR| vtkXOpenGLRenderWindow (0x40458a6660): bad X server connection. DISPLAY=๏ฟฝ[0m
qemu: uncaught target signal 6 (Aborted) - core dumped
/opt/micapipe/functions/micapipe_qc: line 189:   634 Aborted                 ${MICAPIPE}/functions/qc_surf.py -subBIDS "$idBIDS" -subDir "$subject_dir"
๏ฟฝ[38;5;118m

Recommend modify line 187 of 02_proc-dwi.sh to include threshold for B=0 shell values & to deal with non integer shell values

Current line will only remove shells with b values exactly equal to 0, and will return error on non-integer values. Wouldn't be able to handle the following case:

$ shells=($(mrinfo "$dwi_n4" -shell_bvalues))
$ echo ${#shells[@]}
   4

$ for i in "${!shells[@]}"; do echo ${shells[i]}; done
   5
   299.5
   699.875
   1996.61

Suggest replacing line 187 with:

$ thr=15
$ for i in "${!shells[@]}"; do if [ ${shells[i]%.*} -le $thr ]; then unset 'shells[i]'; fi; done
$ echo ${#shells[@]}
   3

ANTs error

I am running micapipe on my university's cluster, and I am getting a 'cannot stat' error when running proc-structural. This happens during the ANTs step. Running proc_structural therefore results in an error. I am trying to run proc_structural to completion.

I am using MobaXterm v20.3 build 4396 to tunnel into my university cluster from my work computer.

My BIDS format:

dataset/
rawdata/
sub-001/
ses-0/
anat/
sub-001_ses-0_run-1_T1w.nii
sub-001_ses-0_run_1_T1w.json
dwi/...
fmap/...
func/...
ses-1/...
derivatives/
freesurfer/
sub-001_ses-0/
label/
mri/
...
sub-001_ses-1/...
micapipe/

Because I am not allowed to run sudo command on the cluster,

I pulled the docker image into a singularity wrapper:

# Create a .singularity directory in Scratch
mkdir $HOME/Scratch/.singularity 

# Create cache subdirectories we will use / export
mkdir $HOME/Scratch/.singularity/tmp
mkdir $HOME/Scratch/.singularity/localcache
mkdir $HOME/Scratch/.singularity/pull

# Set all the Singularity cache dirs to Scratch
export SINGULARITY_CACHEDIR=$HOME/Scratch/.singularity
export SINGULARITY_TMPDIR=$SINGULARITY_CACHEDIR/tmp
export SINGULARITY_LOCALCACHEDIR=$SINGULARITY_CACHEDIR/localcache
export SINGULARITY_PULLFOLDER=$SINGULARITY_CACHEDIR/pull

# Bind the data directory in Scratch so it is accessible from inside the container and the temporary storage jobs are allocated
# add after $USER
export SINGULARITY_BINDPATH=/scratch/scratch/$USER,/tmpdir

# to pull docker image
singularity pull docker://micalab/micapipe:latest

# Prints micapipe version / test commands can be used (this is equivalent to running mica-pipe command)
$SINGULARITY_PULLFOLDER/micapipe_latest.sif -v

below is the error report I get when running proc_structural

[ucjucrs@login12 MICA_BIDS]$ export SINGULARITY_CACHEDIR=$HOME/Scratch/.singularity
[ucjucrs@login12 MICA_BIDS]$ export SINGULARITY_TMPDIR=$SINGULARITY_CACHEDIR/tmp
[ucjucrs@login12 MICA_BIDS]$ export SINGULARITY_LOCALCACHEDIR=$SINGULARITY_CACHEDIR/localcache
[ucjucrs@login12 MICA_BIDS]$ export SINGULARITY_PULLFOLDER=$SINGULARITY_CACHEDIR/pull
[ucjucrs@login12 MICA_BIDS]$ export SINGULARITY_BINDPATH=/scratch/scratch/$USER/Struct_MRI/MICA_BIDS/,/tmpdir
[ucjucrs@login12 MICA_BIDS]$ $SINGULARITY_PULLFOLDER/micapipe_latest.sif -bids /home/ucjucrs/Scratch/Struct_MRI/MICA_BIDS/rawdata -out /home/ucjucrs/Scratch/Struct_MRI/MICA_BIDS/derivatives -sub 001 -ses 0 -proc_structural
WARNING: Bind mount '/home/ucjucrs => /home/ucjucrs' overlaps container CWD /home/ucjucrs/Scratch/Struct_MRI/MICA_BIDS, may not be available
Some packages in this Docker container are non-free
If you are considering commercial use of this container, please consult the relevant license:
https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /opt/freesurfer-6.0.0
FSFAST_HOME       /opt/freesurfer-6.0.0/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /opt/freesurfer-6.0.0/subjects
MNI_DIR           /opt/freesurfer-6.0.0/mni
FSL_DIR           /opt/fsl-6.0.0


-------------------------------------------------------------
        MICA pipeline - (Version v0.1.1 'Roadrunner')
                Subject: 001 Session: ses-0
-------------------------------------------------------------

[ WARNING ]..... fix was not found, ICA-FIX will be skipped

[ INFO ]..... micapipe will use 6 threads for multicore processing

[ INFO ]..... Subject 001 directory exist

[ INFO ]..... sub-001 directory structure:

/scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0
โ”œโ”€โ”€ anat
โ”‚ย ย  โ”œโ”€โ”€ first
โ”‚ย ย  โ”œโ”€โ”€ surfaces
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ conte69
โ”‚ย ย  โ””โ”€โ”€ volumetric
โ”œโ”€โ”€ dwi
โ”œโ”€โ”€ func
โ”œโ”€โ”€ logs
โ”œโ”€โ”€ QC
โ”‚ย ย  โ””โ”€โ”€ png
โ””โ”€โ”€ xfm

11 directories


-------------------------------------------------------------
        Structural processing
                micapipe v0.1.1 'Roadrunner', LOCAL
-------------------------------------------------------------

[ INFO ]..... MICA pipe - Software versions
                MRtrix3.....    3.0.1
                                /opt/miniconda-latest/envs/micapipe/bin/mrinfo
                FSL.........    6.0
                                /opt/fsl-6.0.0
                ANFI........     Aug 22 2021 (Version AFNI_21.2.05 'Nerva')
                                /opt/afni-latest/3dresample
                ANTS........     2.3.3.dev168-g29bdf
                                /opt/ants-2.3.4
                WorkBench...    1.3.2
                                /usr/bin/wb_command
                FreeSurfer..    freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
                                /opt/freesurfer-6.0.0
                fix.........
                                /opt/fix
                python......    Python 3.7.10
                                /opt/miniconda-latest/envs/micapipe/bin/python
                R...........    3.6.3
                                /usr/bin/R

[ INFO ]..... mica-pipe inputs:
                id   =  001
                BIDS =  /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/rawdata
                out  =  /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe
                ses  =  ses-0

[ INFO ]..... BIDS naming:
                subject_bids =  /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/rawdata/sub-001/ses-0
                bids_T1ws    =  N-1, e.g. /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/rawdata/sub-001/ses-0/anat/sub-001_ses-0_run-1_T1w.nii
                bids_dwis    =  N-0, e.g.
                subject      =  sub-001
                subject_dir  =  /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0
                proc_struct  =  /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/anat
                dir_warp     =  /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/xfm
                logs         =  /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/logs

[ INFO ]..... Processing directories:
                subject_dir     =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0
                proc_struct     =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/anat
                dir_conte69     =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69
                dir_volum       =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/anat/volumetric
                dir_warp        =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/xfm
                dir_logs        =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/logs
                dir_QC          =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/QC
                dir_freesurfer  =       /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/freesurfer/sub-001_ses-0

[ INFO ]..... Utilities directories:
                scriptDir         =     /opt/micapipe/functions
                util_MNIvolumes   =     /opt/micapipe/MNI152Volumes
                util_lut          =     /opt/micapipe/parcellations/lut
                util_parcelations =     /opt/micapipe/parcellations
                util_surface      =     /opt/micapipe/surfaces
                util_mics         =     /opt/micapipe/MICs60_T1-atlas

[ INFO ]..... Saving temporal dir: FALSE

[ INFO ]..... ANTs will use 6 threads

ucjucrs @ login12.myriad.ucl.ac.uk Thu Sep 30 10:47:17 BST 2021:
COMMAND -->   mkdir -p /tmp/30415_micapipe_proc_struc-vol_001

ucjucrs @ login12.myriad.ucl.ac.uk Thu Sep 30 10:47:17 BST 2021:
COMMAND -->   3dresample -orient LPI -prefix /tmp/30415_micapipe_proc_struc-vol_001/obl-001_ses-0_run-1_T1w.nii -inset /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/rawdata/sub-001/ses-0/anat/sub-001_ses-0_run-1_T1w.nii

ucjucrs @ login12.myriad.ucl.ac.uk Thu Sep 30 10:47:17 BST 2021:
COMMAND -->   fslreorient2std /tmp/30415_micapipe_proc_struc-vol_001/obl-001_ses-0_run-1_T1w.nii /tmp/30415_micapipe_proc_struc-vol_001/reo-001_ses-0_run-1_T1w.nii

ucjucrs @ login12.myriad.ucl.ac.uk Thu Sep 30 10:47:20 BST 2021:
COMMAND -->   cp -v /tmp/30415_micapipe_proc_struc-vol_001/reo-001_ses-0_run-1_T1w.nii /tmp/30415_micapipe_proc_struc-vol_001/sub-001_ses-0_space-nativepro_t1w_n4.nii.gz
cp: cannot stat '/tmp/30415_micapipe_proc_struc-vol_001/reo-001_ses-0_run-1_T1w.nii': No such file or directory

[ INFO ]..... T1w_nativepro biasfield correction and intensity rescaling

ucjucrs @ login12.myriad.ucl.ac.uk Thu Sep 30 10:47:20 BST 2021:
COMMAND -->   N4BiasFieldCorrection -d 3 -i /tmp/30415_micapipe_proc_struc-vol_001/sub-001_ses-0_space-nativepro_t1w_n4.nii.gz -r -o /tmp/30415_micapipe_proc_struc-vol_001/sub-001_ses-0_space-nativepro_t1w_n4.nii.gz -v

Running N4 for 3-dimensional images.

 file /tmp/30415_micapipe_proc_struc-vol_001/sub-001_ses-0_space-nativepro_t1w_n4.nii.gz does not exist .
Mask not read.  Using the entire image as the mask.

/opt/micapipe/functions/utilities.sh: line 584: 95445 Segmentation fault      $l_command

ucjucrs @ login12.myriad.ucl.ac.uk Thu Sep 30 10:47:20 BST 2021:
COMMAND -->   ImageMath 3 /scratch/scratch/ucjucrs/Struct_MRI/MICA_BIDS/derivatives/micapipe/sub-001/ses-0/anat/sub-001_ses-0_space-nativepro_t1w.nii.gz RescaleImage /tmp/30415_micapipe_proc_struc-vol_001/sub-001_ses-0_space-nativepro_t1w_n4.nii.gz 0 100
 file /tmp/30415_micapipe_proc_struc-vol_001/sub-001_ses-0_space-nativepro_t1w_n4.nii.gz does not exist .
terminate called after throwing an instance of 'itk::ExceptionObject'
  what():  /src/ants/build/ITKv5/Modules/Core/Common/src/itkProcessObject.cxx:1340:
itk::ERROR: RescaleIntensityImageFilter(0x43cfa80): Input Primary is required but not set.
/opt/micapipe/functions/utilities.sh: line 584: 95486 Aborted                 $l_command

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

[ ERROR ]..... sub-001_ses-0_space-nativepro_t1w was not generated

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


ucjucrs @ login12.myriad.ucl.ac.uk Thu Sep 30 10:47:20 BST 2021:
COMMAND -->   exit
Erasing temporal directory: /tmp/*_micapipe*_001
OLD_PATH is unset or empty


-------------------------------------------------------------
        GLOBAL micapipe running time with LOCAL processing: 0.083 minutes
-------------------------------------------------------------

adding JuBrain parcellation

Hi Raul/Jess - together with Casey, we were discussing to incorporate the JuBrain parcellation into the default parcellations that are used for connectome generation in a future release of micapipe. She has already the parcellation in MNI152 but also fsaverage and conte69. The parcellation is partial (ie not all brain regions have a label) but this may nevertheless be useful to link micapipe with some of the julich projects for hiball etc. - what do you think?

Ran commands successfully but no results files generated

Hi!

I ran micapipe by docker with the following commands:
docker run -ti --rm
-v /my_path/bids:/data:ro
-v /my_patht/micapipe/derivatives:/out
-v /my_path/micapipe/working_directory:/tmp
-v /my_path/license.txt:/opt/freesurfer/license.txt
micalab/micapipe:latest -bids /data -out /out
-proc_structural -sub 03 04 -threads 10 -tracts 10M

It seems that it ran successfully but there is no results generated under derivative and working_dirctory except these. The folders of freesurfer and sub-03 can not be opened or deleted. My input data is in BIDS format which can be used to fmriprep (so I guess it might not result from my data).
micapipe
โ”œโ”€โ”€ derivatives
โ”‚ย ย  โ”œโ”€โ”€ freesurfer [error opening dir]
โ”‚ย ย  โ””โ”€โ”€ micapipe
โ”‚ย ย  โ”œโ”€โ”€ micapipe_processed_sub.csv
โ”‚ย ย  โ”œโ”€โ”€ pipeline-description.json
โ”‚ย ย  โ””โ”€โ”€ sub-03 [error opening dir]
โ””โ”€โ”€ working_directory

Thank you so much if you can give me any idea to deal with this. Happy holiday!

Running micapipe_cleanup with Docker

Hello everyone,

I am trying to run micapipe_cleanup using a linux machine with docker.
However I keep getting the error that the repository does not exist.

I have been using the following command:
docker run -it micalab/micapipe:latest micapipe_cleanup (arguments...)
The following command also did not work for me:
docker run -it micalab/micapipe:latest /opt/micapipe/functions/micapipe_cleanup (arguments...)

Could anyone help me with constructing a proper Docker command? Thank you in advance!

Incorporate FastSurfer

  • What is the current behaviour?

  • Freesurfer is slow and fix_topology is a problem.

  • What is the motivation / use case for changing the behaviour?

  • Speedup, no vertex correction issues in fix_topology

  • Other information
    FastSurfer https://deep-mi.org/research/fastsurfer/ would be a great alternative to Freesurfer cortical parc. and segmentation.
    https://github.com/deep-mi/FastSurfer
    Drawbacks: It resamples T1w images to 1mm iso if they are hires - could include an option for choosing either stream (free vs fastsurfer)

Cannot persuade version 0.1.4 to run proc_structural

  • What is the current behavior?
    I pulled the current version of micapipe (v. 0.1.4) today in a Singularity image for use on my HPC. To check everything running, I was going to run single participant in very stepwise progression to make sure I understood the outputs at each step. My intention is to reuse my already run Freesurfer 7.3.1 data but is somewhat optional. This is my call:
singularity run --cleanenv \
-B /xdisk/adamraikes/cornell/nifti:/nifti:ro \
-B /xdisk/adamraikes/cornell/derivatives/freesurfer-7.3.1:/fs_input \
-B /xdisk/adamraikes/cornell/derivatives/micapipe:/output \
-B /tmp:/tmp \
-B /groups/adamraikes/license.txt:/opt/freesurfer-6.0.0/license.txt \
/groups/adamraikes/singularity_images/micapipe-v0.1.4.simg 
-bids /nifti \
-out /output \
-sub 087 \
-threads 8 \
-proc_structural

This is the output when I do so:

Some packages in this Docker container are non-free
If you are considering commercial use of this container, please consult the relevant license:
https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /opt/freesurfer-6.0.0
FSFAST_HOME       /opt/freesurfer-6.0.0/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /opt/freesurfer-6.0.0/subjects
MNI_DIR           /opt/freesurfer-6.0.0/mni
FSL_DIR           /opt/fsl-6.0.3

[ WARNING ]..... DEPRECATION: mica-pipe is deprecated and will be removed from upcoming versions (use micapipe instead) 


micapipe -bids /nifti -out /output -sub 087 -threads 8 -proc_structural


-------------------------------------------------------------
	MICA pipeline - (Version v0.1.4 'Roadrunner') 
		Subject: 087 Session: SINGLE
-------------------------------------------------------------

[ WARNING ]..... fix was not found, ICA-FIX will be skipped 

[ INFO ]..... micapipe will use 8 threads for multicore processing 

[ INFO ]..... Subject 087 directory doesn't exist 

adamraikes @ r4u11n1.puma.hpc.arizona.edu Mon Nov 21 12:30:26 MST 2022:
COMMAND -->   mkdir -p /output/micapipe/sub-087/logs /output/micapipe/sub-087/xfm /output/micapipe/sub-087/dwi /output/micapipe/sub-087/func /output/micapipe/sub-087/anat/first /output/micapipe/sub-087/anat/volumetric /output/micapipe/sub-087/anat/surfaces/conte69 /output/micapipe/sub-087/QC/png  

adamraikes @ r4u11n1.puma.hpc.arizona.edu Mon Nov 21 12:30:26 MST 2022:
COMMAND -->   ln -s /opt/freesurfer-6.0.0/subjects/fsaverage5/ /output/freesurfer  

adamraikes @ r4u11n1.puma.hpc.arizona.edu Mon Nov 21 12:30:26 MST 2022:
COMMAND -->   mkdir -p /output/freesurfer/conte69/surf  

[ INFO ]..... sub-087 directory structure:
 
/output/micapipe/sub-087
\u251c\u2500\u2500 anat
\u2502ย ย  \u251c\u2500\u2500 first
\u2502ย ย  \u251c\u2500\u2500 surfaces
\u2502ย ย  \u2502ย ย  \u2514\u2500\u2500 conte69
\u2502ย ย  \u2514\u2500\u2500 volumetric
\u251c\u2500\u2500 dwi
\u251c\u2500\u2500 func
\u251c\u2500\u2500 logs
\u251c\u2500\u2500 QC
\u2502ย ย  \u2514\u2500\u2500 png
\u2514\u2500\u2500 xfm

11 directories
/opt/micapipe/micapipe: line 666: /opt/micapipe/functions/01_proc-struc_volumetric.sh /nifti 087 /output/micapipe SINGLE FALSE 8 /tmp DEFAULT: No such file or directory
/opt/micapipe/micapipe: line 949: [: too many arguments


-------------------------------------------------------------
	GLOBAL micapipe running time with container-micapipe v0.1.4 processing: 0.000 minutes 
-------------------------------------------------------------

It generates the relevant file tree as expected but fails after creating the folders. The same command works for my v0.1.2 singularity image.

2 "missing" files in QC report

  • What is the current behavior?
    Hi! I consistently get an orange line in my workflows in my QC reports (the line is labeled ("proc_structural- proc_dwi 50").
    I also consistently get a "FILE NOT FOUND" for these two files:
  • "Registration: T1w in DWI space" in the proc_dwi QC module
  • "Registration: FA atlas in native dwi" in the bundle segmentation QC module

I assume those two missing files are related to why the workflow line is orange (everything else in the QC reports look fine).

I think I see the "missing" files in my dwi folders (so they're not actually missing), but I'm not certain these are what it wants:
For example:
sub-02E_ses-01_space-dwi_desc-t1w_nativepro_SyN.nii.gz
sub-02E_ses-01_space-dwi_model-DTI_map-FA.mif

  • What is the expected behavior?
    Screenshots of these two files should appear in the QC report and the workflow line should not be orange.

  • Please tell us about your computing environment:
    I'm running micapipe v0.1.2 in the provided singularity container.

  • Other information
    The terminal output while running QC is not informative when it gets to each of these missing files:
    This is the terminal output when QC gets to the missing T1w in DWI space:
    [ INFO ]..... Registration: T1w in DWI space

And this is the terminal output when QC gets to the missing FA atlas image:

[ INFO ]..... Registration: FA atlas in native dwi 
Erasing temporal directory: /tmp
OLD_PATH is unset or empty

Results from auto_tract

Hi, I'm using auto_tract standalone pipeline to do bundle segmentation with whole-brain tractogram we estimated before.
Tractograms were estimated with matrix3 iFOD2.
When I run auto_tract pipeline, however, there were no streamline counted as Fornix of both hemisphere.
I think it is weird because when I open tractogram files, there were streamlines on the Fornix
Are there any tips or cautions I need to know for running auto_tract pipeline?

building micapipe in docker on MacOS M1

Hi all,

when trying to run micapipe on my MacOS Monterey (12.2.1) with M1, I get an error relating to arm-based system of Mac since micapipe requires a linux/amd64 platform.
One solution suggested on the net is to build micapipe before using it and so I have run docker build https://github.com/MICA-MNI/micapipe.git --platform linux/amd64
It started to build nicely installing several dependencies, but got stuck on step 6/23 when building FSL python environment:

error message

[ 6/23] RUN bash -c 'bash /opt/fsl-6.0.0/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.0':                                                                
#8 8.533 Stage 1                                                                
#8 8.533 By installing this python distribution you agree to the license terms in
#8 8.533 /opt/fsl-6.0.0/fslpython/LICENSE.txt
100%.758 
#8 42.70 Stage 2
100%5.15 
#8 882.4 /opt/fsl-6.0.0/etc/fslconf/fslpython_install.sh: line 203:   759 Killed                  FSLDIR=$fsl_dir "${miniconda_bin_dir}/conda" env create -f "${script_dir}/fslpython_environment.yml" 2>> "${miniconda_install_log}"
#8 882.4        761 Done                    | ${script_dir}/progress.sh 133 ${quiet} >> "${miniconda_install_log}"
#8 882.4 Failed to create FSL Python environment - see /tmp/fslpythonesRS/fslpython_miniconda_installer.log for details
------
executor failed running [/bin/sh -c bash -c 'bash /opt/fsl-6.0.0/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.0']: exit code: 4

M1 users, any suggestions on how to make micapipe build/run?

Thank you,
Dominika

Add option to use the the ss3t_csd_beta1 algorithm for single-shelled data.

  • What is the current behaviour?
    • When provided single-shelled data, micapipe uses the "single tissue constrained spherical deconvolution" algorithm for FOD generation.
  • What is the motivation / use case for changing the behaviour?
    • MRtri3Tissue is a fork of MRtrix3 (by Dhollander) which extends the multi-tissue FOD algorithm to single-shelled acquisitions.
    • FOD generation for WM, GM, and CSF is performed using 3Tissue/bin/ss3t_csd_beta1, on response functions generated using the dhollander algorithm.
    • The FODs can be used like normal in tckgen.

Since the program is still experimental, it may be best to turn on this functionality using a flag, e.g. -do_ss3t_csd (name taken from QSIprep).

Alternative distortion correction options

fmriprep uses fieldmaps (magnitude and phasediff) to correct distortion in bold images. It also allows a simple RPE image of the main bold data. Could you implement some of these alternatives?

Thank you!

ReadTheDocs Singularity issues/errors

  • A couple of singularity command errors in the readthedocs

Currently:
singularity run --cleanenv /my_images/micapipe-.simg
-B path/to/your/bids_dataset:/bids_dataset:ro
-B path/to/your/bids_dataset/derivatives:/output_directory
-B path/to/your/working_directory:/tmp
-B path/to/your/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/freesurfer_license_file.txt
micapipe.simg
-bids /bids_dataset
-out /output_directory
-all -ses 01
-threads 10 -tracts 10M

Should be changed to:
*singularity run --cleanenv *
-B path/to/your/bids_dataset:/bids_dataset:ro
-B path/to/your/bids_dataset/derivatives:/output_directory
-B path/to/your/working_directory:/tmp
*-B path/to/your/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/license.txt *
*/path/to/container/micapipe.simg *
-bids /bids_dataset
-out /output_directory
-all -ses 01
-threads 10 -tracts 10M
:)

T1w and T2w suffixes

As we talked about in the preprocessing meeting, PyBIDS doesnโ€™t recognize these file names with lower case ยซย tย ยป

conte69 surface problems

Hi all,
I'm trying to use mica-pipe on some of my data (especially the -SC, -Morphology, and -MPC modules). I am running into a problem, however. I am getting the Freesurfer license error, and I can't figure out why. I've moved it to my home directory and pointed to it, but no luck. I am running Ubuntu 16.04.4 LTS and have current versions of all of the software I need.

The bigger problem seems to be that I can't do anything involving the conte69 surfaces. Proc_structural works fine, and for freesurfer, I copied a prior run (from outside mica-pipe) to my derivatives/freesurfer subdirectory. In the subdirectory, I now see conte69, fsaverage, fsaverage5 and my subject directory. However, within the conte69 directory, I see only a surf subdirectory (surf) which contains lh.conte69.gii and rh.conte69.gii. I have a feeling that this is a problem, but I'm not sure. In any event, it seems that the connectome modules are dependent on proper processing of the conte69 surfaces and registration of images to them. So I'm stuck.

Any help is appreciated!
Best wishes,
Matt

Supply container for HPCs with older kernel versions

  • What is the current behaviour?
    • The converted singularity image does not run on an HPC cluster with CentOS 6.10 (kernel ver: 2.6.32), posting the error: "KERNEL TOO OLD", indicating 2.6.32 is not supported by Ubuntu 18.04's version of glibc.
  • What is the motivation / use case for changing the behaviour?
    • Backporting the container to either ubuntu:xenial or an earlier version of debian will allow researchers with older HPC environments to deploy and use the micapipe container.
  • If relevant, please tell us about your computing environment:
    • Kernel ver: 2.6.32, Distro: CentOS 6.10
  • Other information

Two resting state scans: before and after TMS

We have two runs of rsfmri in a single session:

tree inputs/sub-219/ses-itbs/func
inputs/sub-219/ses-itbs/func
โ”œโ”€โ”€ sub-219_ses-itbs_task-rest_run-01_bold.json
โ”œโ”€โ”€ sub-219_ses-itbs_task-rest_run-01_bold.nii.gz
โ”œโ”€โ”€ sub-219_ses-itbs_task-rest_run-01_events.tsv
โ”œโ”€โ”€ sub-219_ses-itbs_task-rest_run-02_bold.json
โ”œโ”€โ”€ sub-219_ses-itbs_task-rest_run-02_bold.nii.gz
โ””โ”€โ”€ sub-219_ses-itbs_task-rest_run-02_events.tsv

I'd like to process them separately, so I specified and ran two separate docker commands:

docker run -ti --rm \
    -v ${PWD}/inputs:/bids_dataset:ro \
    -v ${PWD}/outputs:/output_directory \
    -v ${PWD}/working:/tmp \
    -v ${PWD}/inputs/code/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/license.txt \
    micalab/micapipe:latest \
    -bids /bids_dataset \
    -out /output_directory \
    -sub 219 -ses itbs \
    -proc_rsfmri \
    -mainScanStr task-rest_run-01_bold -mainScanRun 1

and

docker run -ti --rm \
    -v ${PWD}/inputs:/bids_dataset:ro \
    -v ${PWD}/outputs:/output_directory \
    -v ${PWD}/working:/tmp \
    -v ${PWD}/inputs/code/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/license.txt \
    micalab/micapipe:latest \
    -bids /bids_dataset \
    -out /output_directory \
    -sub 219 -ses itbs \
    -proc_rsfmri \
    -mainScanStr task-rest_run-02_bold -mainScanRun 2

Only the first run claims to have completed. How can I get separate output for each run?

Post_structural runs with errors - cannot find FreeSurfer license?

UPDATE: I have tried making the Freesurfer license accessible to the container by adding '''-B /path/to/your/local/freesurfer-license:/opt/freesurfer-6.0.0/license.txt''' when running -post_structural, but this didn't help. I also tried mounting a file using docker run -v, but this also did not work.

BTW, I pulled the container into a singularity wrapper, and I run commands like this:
$SINGULARITY_PULLFOLDER/micapipe_latest.sif (and then enter commands)

Original post:
I am trying to run the post_structural part of the pipeline. I have previously quality-controlled FreeSurfer files that I would like to include in this step.

I have run -proc_structural without errors prior to this, and I think my FreeSurfer files are in the right location.

My dataset looks like this:

dataset/
---/rawdata
------/sub-001
---------/ses-0
---------/ses-1
------/sub-002
---------/ses-0
....
---/derivatives
------/freesurfer
---------/license.txt
---------/sub-001_ses-0
------------/mri
------------/surf
....
------/micapipe
---------/sub-001
------------/ses-0
....

When I run -post_structural, I get the output below. Would anyone know what is causing this?

[ucjucrs@login12 dataset]$ $SINGULARITY_PULLFOLDER/micapipe_latest.sif -sub 001 -ses 0 -out derivatives -bids rawdata -post_structural -atlas aparc
WARNING: Bind mount '/home/ucjucrs => /home/ucjucrs' overlaps container CWD /home/ucjucrs/Scratch/dataset, may not be available
Some packages in this Docker container are non-free
If you are considering commercial use of this container, please consult the relevant license:
https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /opt/freesurfer-6.0.0
FSFAST_HOME       /opt/freesurfer-6.0.0/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /opt/freesurfer-6.0.0/subjects
MNI_DIR           /opt/freesurfer-6.0.0/mni
FSL_DIR           /opt/fsl-6.0.0


-------------------------------------------------------------
        MICA pipeline - (Version v0.1.1 'Roadrunner')
                Subject: 001 Session: ses-0
-------------------------------------------------------------

[ WARNING ]..... fix was not found, ICA-FIX will be skipped

[ INFO ]..... micapipe will use 6 threads for multicore processing

[ INFO ]..... Subject 001 directory exist

[ INFO ]..... Selected parcellations: aparc, N=1


-------------------------------------------------------------
        POST-structural processing
                micapipe v0.1.1 'Roadrunner', LOCAL
-------------------------------------------------------------

[ INFO ]..... MICA pipe - Software versions
                MRtrix3.....    3.0.1
                                /opt/miniconda-latest/envs/micapipe/bin/mrinfo
                FSL.........    6.0
                                /opt/fsl-6.0.0
                ANFI........     Sep 27 2021 (Version AFNI_21.2.09 'Nerva')
                                /opt/afni-latest/3dresample
                ANTS........     2.3.3.dev168-g29bdf
                                /opt/ants-2.3.4
                WorkBench...    1.3.2
                                /usr/bin/wb_command
                FreeSurfer..    freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
                                /opt/freesurfer-6.0.0
                fix.........
                                /opt/fix
                python......    Python 3.7.10
                                /opt/miniconda-latest/envs/micapipe/bin/python
                R...........    3.6.3
                                /usr/bin/R

[ INFO ]..... Structural processing output variables:
                T1 nativepro    =       /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/sub-001_ses-0_space-nativepro_t1w.nii.gz
                T1 5tt          =       /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/sub-001_ses-0_space-nativepro_t1w_5TT.nii.gz
                T1 fast_all     =       /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/first/sub-001_ses-0_space-nativepro_t1w_all_fast_firstseg.nii.gz
                T1 resolution   =       1.0

[ INFO ]..... Saving temporal dir: FALSE

[ INFO ]..... ANTs will use 6 threads

[ INFO ]..... wb_command will use 6 threads

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   mkdir -p /tmp/16979_micapipe_post-struct_sub-001_ses-0

[ INFO ]..... Subject 001 has a T1 on FreeSurfer space

[ INFO ]..... Cerebellum parcellation to T1-nativepro Volume

[ INFO ]..... Subject 001 has a Cerebellum parcellation on T1-nativepro

[ INFO ]..... Subcortical parcellation to T1-nativepro Volume

[ INFO ]..... Subject 001 has a Subcortical parcellation on T1-nativepro

[ INFO ]..... fsaverage5 annnot parcellations to T1-nativepro Volume

[ INFO ]..... Running surface lh aparc_mics.annot to sub-001

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   mri_surf2surf --hemi lh --srcsubject fsaverage5 --trgsubject sub-001_ses-0 --sval-annot lh.aparc_mics.annot --tval /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/label/lh.aparc_mics.annot
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------
Setting mapmethod to nnf

$Id: mri_surf2surf.c,v 1.103 2015/11/05 22:07:33 greve Exp $

setenv SUBJECTS_DIR /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer
cd /opt/micapipe/parcellations
mri_surf2surf --hemi lh --srcsubject fsaverage5 --trgsubject sub-001_ses-0 --sval-annot lh.aparc_mics.annot --tval /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/label/lh.aparc_mics.annot

sysname  Linux
hostname login12.myriad.ucl.ac.uk
machine  x86_64
user     ucjucrs
srcsubject = fsaverage5
srcval     = (null)
srctype    =
trgsubject = sub-001_ses-0
trgval     = /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/label/lh.aparc_mics.annot
trgtype    =
srcsurfreg = sphere.reg
trgsurfreg = sphere.reg
srchemi    = lh
trghemi    = lh
frame      = 0
fwhm-in    = 0
fwhm-out   = 0
label-src  = (null)
label-trg  = (null)
OKToRevFaceOrder  = 1
UseDualHemi = 0
Reading source surface reg /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/fsaverage5/surf/lh.sphere.reg

[ INFO ]..... Running surface rh aparc_mics.annot to sub-001

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   mri_surf2surf --hemi rh --srcsubject fsaverage5 --trgsubject sub-001_ses-0 --sval-annot rh.aparc_mics.annot --tval /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/label/rh.aparc_mics.annot
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------
Setting mapmethod to nnf

$Id: mri_surf2surf.c,v 1.103 2015/11/05 22:07:33 greve Exp $

setenv SUBJECTS_DIR /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer
cd /opt/micapipe/parcellations
mri_surf2surf --hemi rh --srcsubject fsaverage5 --trgsubject sub-001_ses-0 --sval-annot rh.aparc_mics.annot --tval /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/label/rh.aparc_mics.annot

sysname  Linux
hostname login12.myriad.ucl.ac.uk
machine  x86_64
user     ucjucrs
srcsubject = fsaverage5
srcval     = (null)
srctype    =
trgsubject = sub-001_ses-0
trgval     = /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/label/rh.aparc_mics.annot
trgtype    =
srcsurfreg = sphere.reg
trgsurfreg = sphere.reg
srchemi    = rh
trghemi    = rh
frame      = 0
fwhm-in    = 0
fwhm-out   = 0
label-src  = (null)
label-trg  = (null)
OKToRevFaceOrder  = 1
UseDualHemi = 0
Reading source surface reg /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/fsaverage5/surf/rh.sphere.reg

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   mri_aparc2aseg --s sub-001_ses-0 --o /tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc.mgz --annot aparc_mics --new-ribbon
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------
SUBJECTS_DIR /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer
subject sub-001_ses-0
outvol /tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc.mgz
useribbon 0
baseoffset 0
RipUnknown 0

Reading lh white surface
 /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/lh.white

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   mri_label2vol --seg /tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc.mgz --temp /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/mri/T1.mgz --o /tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc_in_T1.mgz --regheader /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/mri/aseg.mgz
Number of labels: 0
Annot File:      (null)
Template Volume: /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/mri/T1.mgz
Outut Volume: /tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc_in_T1.mgz
Registration File: (null)
Fill Threshold: 0
Label Vox Vol:  1
ProjType:       (null)
ProjTypeId:     0
ProjStart:      0
ProjStop:       0
ProjDelta:      0.1
Subject:  (null)
Hemi:     (null)
UseNewASeg2Vol:  0
DoLabelStatVol  0
LabelCodeOffset  0
setenv SUBJECTS_DIR /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer
$Id: mri_label2vol.c,v 1.46 2014/12/08 21:11:54 greve Exp $
Template RAS-to-Vox: --------
-1.00000  -0.00000  -0.00000   128.00000;
-0.00000  -0.00000  -1.00000   128.00000;
-0.00000   1.00000  -0.00000   128.00000;
-0.00000  -0.00000  -0.00000   1.00000;
Template Voxel Volume: 1
nHits Thresh: 0
Computing registration based on header
RegMat: --------
 1.00000   0.00000   0.00000   0.00000;
 0.00000   1.00000   0.00000   0.00000;
 0.00000   0.00000   1.00000   0.00000;
 0.00000   0.00000   0.00000   1.00000;
Label RAS-to-Vox: --------
-1.00000   0.00000   0.00000   128.00000;
 0.00000   0.00000  -1.00000   128.00000;
 0.00000   1.00000   0.00000   128.00000;
 0.00000   0.00000   0.00000   1.00000;
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   mrconvert /tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc_in_T1.mgz /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz -force
mrconvert: [WARNING] existing output files will be overwritten
mrconvert: [ERROR] cannot access file "/tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc_in_T1.mgz": No such file or directory
mrconvert: [ERROR] error opening image "/tmp/16979_micapipe_post-struct_sub-001_ses-0/aparc_in_T1.mgz"

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   fslreorient2std /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz
ERROR: Could not find image /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   fslmaths /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz -thr 1000 /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz
Image Exception : #63 :: No image files match: /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc
terminate called after throwing an instance of 'armawrap::AWException'
  what():  No image files match: /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc
/opt/micapipe/functions/utilities.sh: line 584: 79209 Aborted                 $l_command

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:00 GMT 2021:
COMMAND -->   antsApplyTransforms -d 3 -i /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz -r /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/sub-001_ses-0_space-nativepro_t1w.nii.gz -n GenericLabel -t /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/xfm/sub-001_ses-0_from-fsnative_to_nativepro_t1w_0GenericAffine.mat -o /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/volumetric/sub-001_ses-0_space-nativepro_t1w_atlas-aparc.nii.gz -v -u int
Using double precision for computations.
Input scalar image: /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz
 file /tmp/16979_micapipe_post-struct_sub-001_ses-0/sub-001_ses-0_space-fsnative_t1w_aparc.nii.gz does not exist .
Reference image: /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/sub-001_ses-0_space-nativepro_t1w.nii.gz
=============================================================================
The composite transform comprises the following transforms (in order):
  1. /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/xfm/sub-001_ses-0_from-fsnative_to_nativepro_t1w_0GenericAffine.mat (type = AffineTransform)
=============================================================================
Default pixel value: 0
Interpolation type: LabelImageGenericInterpolateImageFunction
terminate called after throwing an instance of 'itk::ExceptionObject'
  what():  /src/ants/build/ITKv5/Modules/Core/Common/src/itkProcessObject.cxx:1340:
itk::ERROR: ResampleImageFilter(0x3242580): Input Primary is required but not set.
/opt/micapipe/functions/utilities.sh: line 584: 79218 Aborted                 $l_command

[ INFO ]..... Native surfaces to conte69-64k vertices (lh hemisphere)

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   wb_shortcuts -freesurfer-resample-prep /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/lh.white /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/lh.pial /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/lh.sphere.reg /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/lh.midthickness.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-lh_midthickness.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_lh_sphereReg.surf.gii
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   mris_convert /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/lh.pial /tmp/16979_micapipe_post-struct_sub-001_ses-0/lh.pial.surf.gii
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/lh.pial.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_lh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-lh_pial.surf.gii

While running:
wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/lh.pial.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_lh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-lh_pial.surf.gii

ERROR: NAME OF FILE: lh.pial.surf.gii
PATH TO FILE: /tmp/16979_micapipe_post-struct_sub-001_ses-0

File does not exist.


ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   mris_convert /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/lh.white /tmp/16979_micapipe_post-struct_sub-001_ses-0/lh.white.surf.gii
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/lh.white.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_lh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-lh_white.surf.gii

While running:
wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/lh.white.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_lh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-lh_white.surf.gii

ERROR: NAME OF FILE: lh.white.surf.gii
PATH TO FILE: /tmp/16979_micapipe_post-struct_sub-001_ses-0

File does not exist.


[ INFO ]..... Native surfaces to conte69-64k vertices (rh hemisphere)

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   wb_shortcuts -freesurfer-resample-prep /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/rh.white /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/rh.pial /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/rh.sphere.reg /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/rh.midthickness.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-rh_midthickness.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_rh_sphereReg.surf.gii
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   mris_convert /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/rh.pial /tmp/16979_micapipe_post-struct_sub-001_ses-0/rh.pial.surf.gii
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/rh.pial.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_rh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-rh_pial.surf.gii

While running:
wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/rh.pial.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_rh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-rh_pial.surf.gii

ERROR: NAME OF FILE: rh.pial.surf.gii
PATH TO FILE: /tmp/16979_micapipe_post-struct_sub-001_ses-0

File does not exist.


ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   mris_convert /scratch/scratch/ucjucrs/dataset/derivatives/freesurfer/sub-001_ses-0/surf/rh.white /tmp/16979_micapipe_post-struct_sub-001_ses-0/rh.white.surf.gii
--------------------------------------------------------------------------
ERROR: FreeSurfer license file /opt/freesurfer-6.0.0/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.
--------------------------------------------------------------------------

ucjucrs @ login12.myriad.ucl.ac.uk Tue Nov 16 22:07:01 GMT 2021:
COMMAND -->   wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/rh.white.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_rh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-rh_white.surf.gii

While running:
wb_command -surface-resample /tmp/16979_micapipe_post-struct_sub-001_ses-0/rh.white.surf.gii /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_rh_sphereReg.surf.gii /opt/micapipe/surfaces/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii BARYCENTRIC /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/anat/surfaces/conte69/sub-001_ses-0_space-conte69-32k_desc-rh_white.surf.gii

ERROR: NAME OF FILE: rh.white.surf.gii
PATH TO FILE: /tmp/16979_micapipe_post-struct_sub-001_ses-0

File does not exist.



-------------------------------------------------------------
        Post-structural processing ended in  0.033 minutes :
        Steps completed : 03/08
        Status          : INCOMPLETE
        Check logs      : /scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/logs/post_structural_11-11-2021.txt
/scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/logs/post_structural_12-11-2021.txt
/scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/logs/post_structural_15-11-2021.txt
/scratch/scratch/ucjucrs/dataset/derivatives/micapipe/sub-001/ses-0/logs/post_structural_16-11-2021.txt
-------------------------------------------------------------
Erasing temporal directory: /tmp/16979_micapipe_post-struct_sub-001_ses-0
OLD_PATH is unset or empty
Erasing temporal directory: /tmp/*_micapipe*_001
OLD_PATH is unset or empty


-------------------------------------------------------------
        GLOBAL micapipe running time with LOCAL processing: 0.067 minutes
-------------------------------------------------------------

example docker command in documentation incorrectly specifies freesurfer license

A docker command that uses
-v path/to/your/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/freesurfer_license_file.txt \
as specified in the documentation fails immediately saying that the freesurfer license.txt cannot be found.
The correct bind mount appears to be as follows:
-v path/to/your/freesurfer_license_file.txt:/opt/freesurfer-6.0.0/license.txt \

Include option to disable bvalue scaling

  • What is the current behaviour?
    Micapipe uses default behavior of mrconvert, which includes bvalue scaling.

  • What is the motivation / use case for changing the behaviour?
    For ABCD multishell RSI sequences, bvalue-scaling leads to incorrect DTI estimation. Allowing for an option to not scale bvalues in mrconvert would make the DTI pipeline much more flexible.

Running micapipe_cleanup and other scripts

  • What are you trying to do?
    Trying to run micapipe_cleanup (and other scripts such as micapipe_qc) from docker on my local machine (or singularity on my HPC). It's probably very simple but I just don't know how. I am able to run the main mica-pipe and its processing modules with no problem, but how do I call these additional scripts in a docker (and singularity) command? It would be great to add an example in the Installation/Usage sections for newbs like me. Thank you!

change output directory structure to be bids conform

Ahoi hoi folks,

mica-pipe currently takes a -bids and a -out argument and subsequently creates a new directory with the name of the participant specified via -sub within -out. While it's kinda "BIDS-y", it's not BIDS-conform. Following the BIDS derivatives, a new pipeline specific directory should be created under derivatives and within that a folder for each participant. Furthermore, a pipeline description and json sidecar files need to be generated. For example:

 bids_dataset
        derivatives
              mica-pipe
                    pipeline-description.json
                    sub-001
                            sub-001_T1w_desc-preproc.nii.gz
                            sub-001_T1w_desc-preproc.json
        dataset_description.json
        participants.tsv
        participants.json
        sub-001
        sub-002
  • place outputs under bids_dataset_root_folder/derivatives/micapipe
  • add pipeline_description.json
  • add json sidecar files
  • maybe: remove -out as BIDS derivatives specify where things should go and thus only -bids is needed

Happy to provide further information for any of this.

Cheers, Peer

Bug: mrdegibbs (and dwifslpreproc later) fails in 0.1.5

Pulled and built a docker/singularity image for 0.1.5. Structural and Freesurfer appear to run fine. However, running into issues with -proc_dwi

Call:

singularity run --cleanenv -B ${PWD}/nifti:/nifti:ro -B ${PWD}/derivatives/micapipe:/output -B /groups/adamraikes/license.txt:/opt/freesurfer-6.0.0/license.txt -B /tmp:/tmp /groups/adamraikes/singularity_images/micapipe_0.1.5.sif -bids /nifti -out /output -sub 00228190 -ses 00 -proc_dwi -dwi_main /nifti/sub-00228190/ses-00/dwi/sub-00228190_ses-00_dir-AP_dwi.nii.gz -b0thr 61

Error:

COMMAND -->   mrdegibbs /tmp/10672_micapipe_proc-dwi_00228190/MP-PCA_dwi.mif  -nthreads 6  
mrdegibbs: [ERROR] Expected exactly 2 arguments (1 supplied)
mrdegibbs: [ERROR] Usage: mrdegibbs in out
mrdegibbs: [ERROR] Yours: mrdegibbs /tmp/10672_micapipe_proc-dwi_00228190/MP-PCA_dwi.mif
mrcalc: [ERROR] Could not interpret string "" as either an image path or a numerical value
mrcalc: [ERROR] As image: 
mrcalc: [ERROR] no name supplied to open image!
mrcalc: [ERROR] As numerical value: 
mrcalc: [ERROR] cannot convert empty string to complex float
mrmath: [ERROR] no filename supplied to standard input (broken pipe?)
mrmath: [ERROR] error opening image "-"

Looks like $dns_dwi is never defined

Do_cmd mrdegibbs "$dwi_dns_tmp" "$dwi_dns" -nthreads "$threads"

fschfiletype from fsl v6.0.0 destroys data when working with float32 or uint16 T1w images. Upgrading to v6.0.5 fixes issue.

  • What is the current behavior?
    • fschfiletype program from fsl v6.0.0 (default in micapipe docker image) destroys T1w data when working with uint16 or float32 T1-weighted images.
  • Please provide the steps to reproduce and if possible a minimal demo of the problem
    • Run proc_structural on a uint16 or float32 T1-weighted image using the default micapipe docker container, the artifact from below is produced. Eventually, the workflow terminates due to segmentation faults in fslmaths and fsl-FIRST.
  • What is the expected behavior?
    • The workflow would complete successfully.
  • Please tell us about your computing environment:
    • The default container was used.
  • Proposed Solution:
    • Upgrade FSL to v6.0.2 or 6.0.3, which provide better compatibility for images with data types uint16 and float32.
  • Other information
    • See this post on neurostars for the investigation and discussion of this issue.

Independent DWI sequences are concatenated in final output when processed together.

  • What is the current behavior?
    1. Include two different DWI sequences. (single and multi-shell)
    2. Include two EPI images for distortion correction of respective DWI sequences.
    3. The two independent DWI sequences are concatenated into a single file, rather than two separate files.
    4. Susceptibility distortion correction (SDC) is not performed using the provided EPI image for each DWI sequence.
  • Please provide the steps to reproduce and if possible a minimal demo of the problem
    1. Provide more than one separate DWI sequence using -dwi_main.
    2. Provide respective reverse-PE images for SDC.
  • What is the expected behavior?
    1. Independent DWI sequences would be processed independently, rather than concatenated.
    2. Topup would be called using the provided, respective EPI images.
    3. The output file name would preserve the acq- tag from the original filename
      • i.e. sub-01_acq-multishell_space-dwi_preproc.mif instead of sub-01_space-dwi_desc-dwi_preproc.mif
  • Please tell us about your computing environment:
    Ran via singularity container, micapipe v0.1.1 'Roadrunner'

In my case, would proc_dwi need to be ran on each independent DWI sequence?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.