DTI Metrics + FRF Error

Hi Arnaud,

The command is below:

nextflow run /path/to/tractoflow/main.nf -profile use_gpu --bids_config /path/to/sub-0122/code/tractoflow_bids_struct.json -with-singularity /path/to/scilus_1.6.0.sif -resume -with-report report.html --run_pft_tracking false --run_local_tracking true --local_seeding_mask_type fa --local_fa_seeding_mask_threshold 0.1 --local_tracking_mask_type fa --local_fa_tracking_mask_threshold 0.1 --max_dti_shell_value 3000

Best,
Ameen

Ok, I may have an idea.

A couple of months ago singularity/apptainer had an issue with some NVIDIA libraries. Here is the PR already merged. It has been part of apptainer since version 1.2.5.

Can you make sure you using apptainer/singularity >= 1.2.5 ?

Hope it will solve your issue.
Arnaud

Hi Arnaud,

I am using the singularity version 1.6.0 (scilus_1.6.0.sif). Is this what you are referring to?

Best,
Ameen

Hi @ameenq05 ,

I am a collegue of Arnaud. I will try to help you out while he’s out of office.

What Arnaud’s referring to is not the version of the scilus singularity (1.6.0), but the version of the singularity/apptainer software you are using. If you are using a software version prior to 1.2.5, the local tractography step will fail.

You need to upgrade the version you are using to at least 1.2.5, to have OpenCL work on Nvidia graphics cards, which in turns makes the tractography step work.

Best,

Alex

Hi Alex,

Thanks for clarifying. I am using singularity version 3.6.4.

Best,
Ameen

Hi @ameenq05,

I realized the version 1.2.5 I gave you is for apptainer only, it aligns to about version 3.8.5 of Singularity. Thus, your version of Singularity is outdated. You need to upgrade it to at least 3.8.0 to get full GPU capabilities.

Best,

Alex

1 Like

Hi Alex,

We updated our singularity version and the tracking worked. The output does not look good, however. There are spurious and non-anatomical fibers, particularly in the cerebellum, and above the motor and parietal cortices. The reconstructed DWI data looks fine, could this be an issue with the tracking algorithm itself?

Best,
Ameen



Hello @ameenq05 ,

The BET step seems not to be perfect but it’s not a big deal. If you use fa tracking especially if you use a low FA threshold you can easily end up with streamlines crossing gyris. We suggest at least a FA threshold of 0.15 if you know what you are looking for otherwise you should be more conservative and go for a WM mask instead.

Which software do you use to visualize your data ?
You can use MI-Brain to dig into your data by creating a small box and explore your data.

If you end up having just spurious streamlines even with more conservatives parameters, I’ll be able to help you if you can send me the bvec that are inside of Eddy_Topup folder and DWI and bval inside Extract_FODF_Shell.

Hope it will help you.
Arnaud

Thanks Arnaud, using the WM mask yields better results.

I’m having another issue regarding my BIDS structure: Tractoflow is not reading my reverse-phase b0 image for some reason.

The .command.err log inside Read_BIDS outputs the following:

2024-11-21 12:33:02 dn003 root[888814] INFO Found 1 subject(s)

2024-11-21 12:33:02 dn003 root[888814] INFO ------------------------

2024-11-21 12:33:02 dn003 root[888814] INFO Validating subject: 0625

2024-11-21 12:33:02 dn003 root[888814] INFO Found one direction.

2024-11-21 12:33:02 dn003 root[888814] INFO Looking for T1 files

2024-11-21 12:33:02 dn003 root[888814] INFO Found 1 T1 files

2024-11-21 12:33:02 dn003 root[888814] WARNING IntendedFor: No file pointing to /path_to_work_dir/94/8620682e3da4fd7c1cc99dc160c9fb/sub-0625/sub-0625/ses-01/dwi/sub-0625_ses-01_dir-AP_dwi.nii.gz

2024-11-21 12:33:02 dn003 root[888814] WARNING No rev image found to correct for geometrical distorsion

It is reading the AP dwi image, T1w image, bval, and bvec files just fine however, and correctly incorporating them into the tractoflow_bids_struct.json file.

Here is the relevant part of the reverse phase b0 .json file (sub-0625_ses-01_dir-PA_run-02_epi.json):


  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20240202",
  "Dcm2bidsVersion": "3.2.0",
  "IntendedFor": [
    "ses-01/dwi/sub-0625_ses-01_dir-AP_dwi.nii.gz"
  ],
  "parent": "fmap"

And a tree of my BIDS directory, which passes the BIDS validator:

sub-0625
β”œβ”€β”€ CHANGES
β”œβ”€β”€ README
β”œβ”€β”€ dataset_description.json
β”œβ”€β”€ derivatives
└── sub-0625
    └── ses-01
        β”œβ”€β”€ anat
        β”‚   β”œβ”€β”€ sub-0625_ses-01_FLAIR.json
        β”‚   β”œβ”€β”€ sub-0625_ses-01_FLAIR.nii.gz
        β”‚   β”œβ”€β”€ sub-0625_ses-01_T1w.json
        β”‚   └── sub-0625_ses-01_T1w.nii.gz
        β”œβ”€β”€ dwi
        β”‚   β”œβ”€β”€ sub-0625_ses-01_dir-AP_dwi.bval
        β”‚   β”œβ”€β”€ sub-0625_ses-01_dir-AP_dwi.bvec
        β”‚   β”œβ”€β”€ sub-0625_ses-01_dir-AP_dwi.json
        β”‚   └── sub-0625_ses-01_dir-AP_dwi.nii.gz
        └── fmap
            β”œβ”€β”€ sub-0625_ses-01_dir-PA_epi.bval
            β”œβ”€β”€ sub-0625_ses-01_dir-PA_epi.bvec
            β”œβ”€β”€ sub-0625_ses-01_dir-PA_epi.json
            └── sub-0625_ses-01_dir-PA_epi.nii.gz

As always, I appreciate your guidance.

Hello,

Your intendedFor field should look like this one:

β€œIntendedFor”: β€œbids::sub-0625/ses-01/dwi/sub-0625_ses-01_dir-AP_dwi.nii.gz”

Did you use the old behavior of bids uri ? link

Hi Arnaud,

I tried that version of the IntendedFor field, and it still produces the same issue.

Hi Arnaud,

I found the problem. This particular dataset was acquired with a misalignment in TR, TE, and TotalReadoutTime values in AP and PA directions, resulting in the rev b0 not being recognized by Tractoflow.

Moving forward, I wanted to clarify the recommended versions for the following:

  • sclius container
  • nextflow
  • tractoflow
  • jdk (Java)

Thank you.

Ameen