Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T2 images rotated during T2 to T1 alignment in preBIBSNet #50

Open
moser297 opened this issue Jun 6, 2023 · 3 comments
Open

T2 images rotated during T2 to T1 alignment in preBIBSNet #50

moser297 opened this issue Jun 6, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@moser297
Copy link
Collaborator

moser297 commented Jun 6, 2023

What happened?

For a number of subjects (newborn infants from eLABE dataset) T2 images are rotated during T2 to T1 alignment step in preBIBSNet. The cropped images and even the ACPC aligned images in preBIBSNet look fine but once the T2 gets registered to the T1 it gets rotated. This speaks to an issue in the FSL Flirt T2 to T1 registration step which affects the transformation matrix that is produced during that step. The rotation of the T2 leads to faulty segmentations using model 551.

What command did you use?

env -i ${singularity} run \
-B ${data_dir}/input:/input \
-B ${data_dir}/processed:/output \
-B ${data_dir}/work:/workdir \
-B ${run_dir}/license.txt:/opt/freesurfer/license.txt \
/home/faird/shared/code/internal/pipelines/cabinet_container/cabinet_v2-4-0.sif \
/input /output participant -w workdir -jargs /home/cabinet/parameter-file-container.json -start prebibsnet -end postbibsnet -v

What version of CABINET are you using?

2.4.0

Relevant log output

No response

Add any additional information or context about the problem here.

No response

@moser297 moser297 added the bug Something isn't working label Jun 6, 2023
@audreymhoughton
Copy link
Collaborator

From @LuciMoore in a slack conversation:

It looks fine if you use -dof 6 and remove -cost mutualinfo -searchrx -15 15 -searchry -15 15 -searchrz -15 15 from the flirt command, so we can add this as an option for the eta squared stuff

I wonder if we could run the eta2 comparison right after T2-to-T1 registration and then proceed only with workflows that have successful registration (and then run eta2 again at the end of course to choose the best inputs for nnUNet)

@LuciMoore
Copy link
Contributor

I was thinking we could also run the eta square comparison directly after T2-to-T1 registration in the ACPC and non-ACPC paths to exit the path if the eta2 value is below some threshold. However, the eta2 values for Julia's misaligned subjects were {'ACPC': 0.8089966057263998, 'non-ACPC': 0.814770576274034} and {'ACPC': 0.7599261554266752, 'non-ACPC': 0.7791058493865054} for 2 different subjects, which don't seem low enough to establish a useful threshold. So perhaps we could run the ACPC and non-ACPC paths with both T2-to-T1 registration flirt commands (for a total of 4 prebibsnet workflows/paths), perform the eta2 comparison immediately post T2-to-T1 registration, and then only complete the path with the highest eta2 value to produce the prebibsnet output anatomicals

@LuciMoore
Copy link
Contributor

I checked in with Fez about this and he agrees we should run the cost function step after T2-to-T1 registration. Ideally the T2-T1 registration with cost function would be a modular step that does the following:

  • perform multiple forms of T2-T1 registration (in this case 4 - 2 flirt commands for non-ACPC path and 2 flirt commands for ACPC path)
  • use eta2 to pick the best image pair and accompanying prebibsnet workflow (non-ACPC or ACPC)
  • output necessary files and chosen workflow to execute next steps

We would then execute remaining steps for either the ACPC or non-ACPC workflow (not both) to produce the final outputs to feed into BIBSNet

We can take a less elegant approach for now if there are easier and quicker ways to rework the code. I'm happy to help either way

@LuciMoore LuciMoore self-assigned this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants