template/fd/IN.mif file in Fibre density and cross-section pipeline

Hello all,

I’m having the same issue as this user and can’t seem to find an answer anywhere;

In Step 18,

foreach * : mrcalc …/template/fd/IN.mif …/template/fc/IN.mif -mult
…/template/fdc/IN.mif

Are the …/template/fd/IN.mif files the same as those
…/template/fd/PRE.mif file, which were the output of Step16,

foreach * : fixelcorrespondence IN/fixel_in_template_space/fd.mif
…/template/fixel_mask …/template/fd PRE.mif

I was not able to locate the …/template/fd/IN.mif.

Thanks!

Welcome Archie!

I was not able to locate the …/template/fd/IN.mif.

Image “…/template/fd/IN.mif” does not exist. The text string “IN” is a substitution to be manipulated by the for_each command.

I’m having the same issue as this user and can’t seem to find an answer anywhere;

Can you please add a link to the thread / post to which you are referencing.

In Step 18,

Since the documented example pipeline can change between software versions—and I can tell that you’re referencing an out-of-date version of MRtrix3 as foreach was renamed to for_each—could you please also verify that you are looking at the version of the online documentation that matches the version of MRtrix3 that you are using, and quote for us here that version (more info on versioned documentation here).

Thanks
Rob

Hi Rob, thanks for getting back to me.

Yes sorry the post I was referring to was an old one. The updated documentation that I’m using (Fibre density and cross-section - Multi-tissue CSD — MRtrix 3.0 documentation) in step 18 says to use;

for_each * : mrcalc …/template/fd/IN.mif …/template/fc/IN.mif -mult …/template/fdc/IN.mif

However, I’m not actually using the batch processing function and am just trying to process a single subject at the moment using - mrcalc …/template/fd/IN.mif …/template/fc/IN.mif -mult …/template/fdc/IN.mif

The problem I’ve encountered is that I can’t find anywhere in the Fibre Density and Cross Section (Multi-Tissue CSD) documentation where the fd/IN.mif file is created to complete the above line of code. I’m using Matrix 3.0 as well.

Thanks,
Archie

IN is replace within the for_each call:

The full matching pattern, including leading folders. For
example, if the target list contains a file “folder/image.mif”, any
occurrence of “IN” will be substituted with “folder/image.mif”.

IN represents the files or folders that match the first argument of for_each and only makes sense if you use it within for_each.

For instance, if we have two files that match the pattern *.mif.gz (see Specifying filenames: paths — Unix command-line tutorial documentation):

ls *.mif.gz
subject.mif.gz  template.mif.gz

You can convert these to .nii.gz via:

for_each -test *.mif.gz : mrconvert IN UNI.nii.gz
for_each: Command strings for 2 jobs:
Input:   "subject.mif.gz"
Command: mrconvert subject.mif.gz subject.nii.gz
Input:   "template.mif.gz"
Command: mrconvert template.mif.gz template.nii.gz

where UNI is the

unique part of the input after removing any common prefix
and common suffix. For example, if the target list contains files:
“folder/001dwi.mif”, “folder/002dwi.mif”, “folder/003dwi.mif”, any
occurrence of “UNI” will be substituted with “001”, “002”, “003”.