Skip to content

Fix interaction between GDC and registration#143

Merged
Lestropie merged 2 commits intodevfrom
fix_registration_GDC
Mar 18, 2026
Merged

Fix interaction between GDC and registration#143
Lestropie merged 2 commits intodevfrom
fix_registration_GDC

Conversation

@Lestropie
Copy link
Copy Markdown
Collaborator

Tagging @ppruc, @aaroncapon.

This looks to me to produce an adequate alignment; see below.

@ppruc Note that the black pepper artifact we saw in the pseudo-b=0 generated from the T1w is still present. This is due to the use of SynthStrip in deriving a DWI brain mask. Its priors on brain shape result in the inclusion of hypointense voxels at the inferior edge of the frontal lobes where there is signal dropout. When included in the intensity histograms to be matched, this pulls the brightest T1w voxels down to b=0 background intensity levels. This could likely be mitigated with some heuristic, but realistically I don't think this effect should be too deleterious to rigid-body registration.

I've only run these commands manually, so fingers crossed I've not borked the syntax somewhere.

Will be merged into #137 once confirmed working.


anim

- Use eroded masks for histogram matching and registration to mitigate hypointensities at the peripheries of the masks leading to hyperintensities in the contrast-inverted images.
- Perform contrast inversion using a linear rather than reciprocal transform, taking into account the prospect of values that are negative / zero / small in magnitude (which could be introduced by eg. gradient non-linearity distortion correction of the T1w) that have a deleterious effect on the reciprocal transform.
Closes #142.
Closes #141.
@aaroncapon
Copy link
Copy Markdown

Hi Rob,

Tried running it last night and ran into the following

mrtrix3_connectome: [ERROR] Unhandled Python exception:
mrtrix3_connectome: [ERROR]   UnboundLocalError: cannot access local variable 'dwi_image' where it is not associated with a value
mrtrix3_connectome: [ERROR] Traceback:
mrtrix3_connectome: [ERROR]   /opt/mrtrix3/build/lib/mrtrix3/commands/mrtrix3_connectome/mrtrix3_connectome.py:8 (in execute())
mrtrix3_connectome: [ERROR]     return my_execute()
mrtrix3_connectome: [ERROR]   /opt/mrtrix3/build/lib/mrtrix3/commands/mrtrix3_connectome/execute.py:86 (in execute())
mrtrix3_connectome: [ERROR]     run_preproc(app.ARGS.bids_dir,
mrtrix3_connectome: [ERROR]   /opt/mrtrix3/build/lib/mrtrix3/commands/mrtrix3_connectome/preproc/run.py:727 (in run_preproc())
mrtrix3_connectome: [ERROR]     dwi_gdc_image = pathlib.Path(f'{dwi_image.stem}_gdc.mif')

Run command was:

apptainer exec --nv \
--bind /data/gpfs/projects/punim1704 \
/data/gpfs/projects/punim1704/AEP/software/images/mrtrix3_connectome-v0.7.0.sif \
mrtrix3_connectome \ 
/data/gpfs/projects/punim1704/aaron_testing/mrtrix3_connectome_preproc_coreg_issue/work/mrtrix3_connectome/BIDS \
/data/gpfs/projects/punim1704/aaron_testing/mrtrix3_connectome_preproc_coreg_issue/work/mrtrix3_connectome preproc \
-participant_label 100590 \
-t1w_preproc \
/data/gpfs/projects/punim1704/aaron_testing/mrtrix3_connectome_preproc_coreg_issue/work/mrtrix3_connectome/BIDS  \
-gdc /data/gpfs/projects/punim1704/AEP/attachments/mrtrix3_connectome/mrtrix3_connectome-v1.0.0    \
-skip-bids-validator      \
-output_verbosity 4   \
-scratch \
/data/gpfs/projects/punim1704/aaron_testing/mrtrix3_connectome_preproc_coreg_issue/work/mrtrix3_connectome/scratch  
-force    \
-nocleanup       

Running with a GPU, if that changes anything.

Error in modifications in 54cff60.
@Lestropie
Copy link
Copy Markdown
Collaborator Author

@aaroncapon Dumb mistake on my part; plz try again.

@aaroncapon
Copy link
Copy Markdown

Tested this last week and the results were checked by Phil. He said they look good.
Thanks!

@Lestropie Lestropie merged commit fbfc131 into dev Mar 18, 2026
0 of 2 checks passed
@Lestropie Lestropie deleted the fix_registration_GDC branch March 18, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants