Comments (10)
Very sorry for the late reply, this error usually suggests that there is no overlap between the images to be registered (or maybe that one image is completely empty). It may be worthwhile to check any previous registration output that was computed, e.g., an affine transformation supposed to align the images before deformable registration.
from dhcp-structural-pipeline.
Thanks, could you also attach the *.additional.err
file?
from dhcp-structural-pipeline.
subject1-session1.additional.err.txt
I created a text file since it doesn't allow me to directly attach the .err file. But the content is the same.
from dhcp-structural-pipeline.
TC_0432_T2_reg.nii.gz
Here is the file I am trying to process.
from dhcp-structural-pipeline.
Thanks, @anisha1807. I was able to reproduce the issue.
In short, see at the end regarding a bug in scripts/misc/pipeline.sh
which causes this issue, where target and source input images to the mirtk register
command are in the wrong order. Below a more detailed tracing of the issue.
Looking at the input to the registration command, it appears that one of the transformations which should be the inverse of another is indeed actually almost identical to this other transformation. More concretely, I looked at the following:
docker cp dhcp-container:/usr/src/structural-pipeline/parameters/../atlases/non-rigid-v2/T2/template-40.nii.gz .
docker cp dhcp-container:/usr/src/structural-pipeline/parameters/../atlases/non-rigid-v2/T2/template-44.nii.gz .
mirtk view \
-target template-{40,44}.nii.gz \
-source workdir/subject1-session1/restore/T2/subject1-session1_restore_bet.nii.gz \
-dofin workdir/subject1-session1/dofs/template-44-subject1-session1-n.dof.gz \
workdir/subject1-session1/dofs/subject1-session1-template-44-n.dof.gz
When looking at these images, I have to check the box "Invert transformation" in both cases to achieve the expected alignment in the Viewer. This suggests that subject1-session1-template-44-n.dof.gz
is correct, but template-44-subject1-session1-n.dof.gz
is not as it should be the inverse of it.
At least one of these transformation files is computed by the segmentation/pipeline.sh script, which in turn simply executes the Draw-EM command
mirtk neonatal-segmentation /data/workdir/subject1-session1/T2/subject1-session1.nii.gz 44 -t 4 -c 1 -p 1 -v 1 -atlas non-rigid-v2
I thus first suspected the issue is with Draw-EM. Above neontal-segmentation
command registers the 44 week template to the bias corrected input image at this line. This computes the transformation dofs/subject1-session1-template-44-n.dof.gz
, i.e., the one we identified above as correct (which explains why the Draw-EM segmentations in workdir/subject1-session1/segmentations/
look fine). Looking through all the steps of mirtk neonatal-segmentation
script, it does indeed not produce nor use the incorrect inverse transformation. So the issue is more likely in the dHCP pipeline then.
Indeed it seems another registration is executed in the additional pipeline:
dhcp-structural-pipeline/scripts/misc/pipeline.sh
Lines 140 to 142 in 84f9322
^^^ This command is the culprit.
The order of target and source suggest that the output transformation maps points from input image to template space, but the naming of the output transformation suggests it should be the mapping from template to input space rather.
@jcupitt Can you have a look at this? This bug seems to be present since @amakropoulos initial commit in 2017. Odd though that it wouldn't have caused issue before?!? Has maybe something else changed more recently?
Also, instead of this extra registration step, it would make sense to just use
mirtk invert-dof dofs/subject1-session1-template-44-n.dof.gz dofs/template-44-subject1-session1-n.dof.gz
when the image to template mapping is available from the Draw-EM output.
from dhcp-structural-pipeline.
@jcupitt found the solution! [EDIT: :-) seems John was faster actually fixing it than me posting this update...]
The incorrect code block referenced above seems obsolete, and was supposed to be replaced by the lines below it:
dhcp-structural-pipeline/scripts/misc/pipeline.sh
Lines 148 to 152 in 84f9322
Removing below lines from scripts/misc/pipeline.sh
resolves the issue.
dhcp-structural-pipeline/scripts/misc/pipeline.sh
Lines 140 to 142 in 84f9322
Thanks, @anisha1807, for bringing this to our attention and sorry for the long wait. @jcupitt will submit a fix soon, which should then also update the Docker image.
from dhcp-structural-pipeline.
For reference, @amakropoulos also fixed this issue less than 1 month ago in the original repo DevelopingHCP@5f7942d
from dhcp-structural-pipeline.
And Andreas found the issue heh.
from dhcp-structural-pipeline.
Oh goodness, I didn't realize the original repo was still being updated. Are there any other fixes we should pick up?
from dhcp-structural-pipeline.
Not for now [I think]. I'll be talking to Antonis next week. There are some other MIRTK issues still outstanding. He had planned to then contribute those upstream once ready and working, I belief.
from dhcp-structural-pipeline.
Related Issues (20)
- exporting surface files (*.dscalar.nii or *.shape.gii) to freesurfer format HOT 1
- Tissue probability maps are not correctly copied
- Error with T1w/T2w maps
- Surface error under docker image
- Error with dhcp-structural-pipeline:fetal in docker
- Native install on Big Sur
- Segmentation error HOT 3
- Installation difficulties HOT 1
- Calculate curvature in the script process-surfaces-hemisphere
- Infant structural T1 data segmentation HOT 1
- mirtk padding failure for tissue labels
- setup.sh Failure HOT 1
- setup.sh failure
- code version for dHCP release 3? HOT 3
- Pipeline outputs
- docker issue apple silicon chips?
- recon-neonatal-cortex error HOT 8
- Surface Reconstruction FAILED, please suggest new parameter values for gaus_curvature and min_width
- Non rigid step failing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dhcp-structural-pipeline.