Hello,
I am trying to register to brain images of separate subjects (both are CTA, already registered between volumes and to template space) which contain only blood vessels. But the arteries aren't matched properly after registration. I'm not sure which parameter I need to tune to solve this issue. I've used the following command :
antsRegistrationSyN.sh -d 3 -t s -f again58Warped.nii -m again88Warped.nii -n NearestNeighbor -j 1 -o result/deformed66
I'm looking for suggestion to get perfect matching of these images.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are too many local minima to get a good registration. You're probably going to need to incorporate additional information such as landmarks to get the quality of registration you want.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks.
But I am not sure what additional information should I use, I've tuned some smoothing factors, convergence rate but it didn't help. Would you please suggest what should I add or which script I can use in ANTs.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
See my previous comment --- "You're probably going to need to incorporate additional information such as landmarks to get the quality of registration you want."
You won't be able to do this by simply changing the parameters in antsRegistration.
Last edit: Nick Tustison 2019-09-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What I mean is that you are not going to be able to use only those images to get the registration you want. Most likely you are going to need to provide the landmarks yourself and then use landmark-based tools in ANTs (or in other packages) to derive the correspondence.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not getting very well how to add the landmarks. Should I take some label points in both the fixed and moving images exactly in the same positions by opening them in ITK-SNAP to get fixedImageWithLabeledLandmarks as well as movingImageWithLabeledLandmarks?
After that do I need to use ANTSUseLandmarkImagesToGetBSplineDisplacementField.exe to get the transformation?
As I read some related discussions, I need to take the transformation from it to apply to other images, but what about these fixed and moving images I used for ANTSUseLandmarkImagesToGetBSplineDisplacementField.exe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I couldn't save image with landmarks in ITK-SNAP. I tried it on slicer, could get landmark points but they are not saved being superimposed with images rather saved as fcsv files.
I'm not getting idea how to use that file in ANTs. Also, how to add that as additional similarity term.
Would you please suggest elaborately?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In ITK-SNAP if I save the segmentation image, it just saves the points I choose rather than the full image with the points on top of it. But when I use the image with that point sets in ANTs, it shows segmentation fault
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well, I've opened the nifti image on ITK-SNAP, used the paint brush and selected 6 points as 6 labels, then saved the segmentation image. It just saves the points. Since I'm taking fixed and moving images separately, when I ran with these images, it shows distance error. The deformation field shows nothing .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What do you mean "it just saves the points"? If you save a segmentation image in ITK-SNAP, then you end up with a segmentation image file which should have the points stored as voxels in an image.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am adding the steps here through images, please help me to find out my mistakes. I took 6 labels in two subjects separately (I couldn't take exact position in both of them as I'm not sure if it is possible in ITK-SNAP), saved the segmentation, then performed the follwoing operation in ANTs:
Hi,
I am adding the steps here through images, please help me to find out my
mistakes. I took 6 labels in two subjects separately (I couldn't take exact
position in both of them as I'm not sure if it is possible in ITK-SNAP),
saved the segmentation, then performed the follwoing operation in ANTs:
Hi,
Thanks for sharing this. Unfortunately, I don't use ANTsR, I am not sure if I can use it on windows with cygwin like ANTs. But after checking car_landmarks.R I found that I should be able to directly put the fixed and moving segmentation images as input to antsRegistrationSyN.sh as initial transformation by using -r [untitled.nii.gz untitled1.nii.gz 1] but it's showing the following error:
Exception Object caught:
itk::ExceptionObject (000000000028D938)
Location: "unknown"
File: C:\Users\DP\Desktop\ANTs210\Examples..\Utilities\antsCommandLineParser.h
Line: 130
Description: itk::ERROR: CommandLineParser(000000000204F120): ERROR: Parse error occured during command line argument processing
ERROR: Unable to convert '[untitled.nii.gz' to type 'unsigned int' as unsigned int
Also, I want to solve my problems in antsUSELandmarksBSplineTransform with the images from ITK-SNAP.
Sorry to ask questions several times.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have tried later with point landmarks and the result is same.
I did it according to you but it's showing some meaningless results. I am adding my detailed steps here.
I've taken the labeled segmented images with pint landmarks from ITK-SNAP which are attached.
I've used this command to get the affine:
ANTSUseLandmarkImagesToGetAffineTransform untitled.nii.gz untitled1.nii.gz [affine] output.mat
Further, I've taken the output.mat as initialtransform to antsRegistration as below:
Try breaking it down in steps. First, try just a 2-D example with only a few landmarks and see if you can get that to work. Then we can go onto the next step.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ok, I've tried with the car example's images:ford and beetle mentioned by stnava. It's 2D but in antsRegistration if I don't choose dimensionality 3, it doesn't work also! Would you please check if the steps I mentioned above is ok or not. I'm not getting idea why it's not working.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am trying to register to brain images of separate subjects (both are CTA, already registered between volumes and to template space) which contain only blood vessels. But the arteries aren't matched properly after registration. I'm not sure which parameter I need to tune to solve this issue. I've used the following command :
antsRegistrationSyN.sh -d 3 -t s -f again58Warped.nii -m again88Warped.nii -n NearestNeighbor -j 1 -o result/deformed66
I'm looking for suggestion to get perfect matching of these images.
There are too many local minima to get a good registration. You're probably going to need to incorporate additional information such as landmarks to get the quality of registration you want.
https://drive.google.com/open?id=1FVPjI1XCMYfV5olT_XV2IC0zmo_TtCGE
https://drive.google.com/open?id=1Iq6AHfOAZ3JvUcKKxlqxQwbGtBitDdz3
These are my two images again58Warped.nii and again88Warped.nii respectively
I want to match atleast the main arteries, also the mca portions and branches of it. I am adding pictures in 2D to show the problems of registration
sorry, the original images are attached here as screenshot. First one is fixed, 2nd one is moving
The pictures confirm what I mentioned earlier. You're going to have to incorporate additional information in order to get the registration you want.
Thanks.
But I am not sure what additional information should I use, I've tuned some smoothing factors, convergence rate but it didn't help. Would you please suggest what should I add or which script I can use in ANTs.
See my previous comment --- "You're probably going to need to incorporate additional information such as landmarks to get the quality of registration you want."
You won't be able to do this by simply changing the parameters in
antsRegistration
.Last edit: Nick Tustison 2019-09-28
Hi, sorry I didn't realize it earlier. So you mean I should use ANTSUseLandmarkImagesToGetAffineTransform
What I mean is that you are not going to be able to use only those images to get the registration you want. Most likely you are going to need to provide the landmarks yourself and then use landmark-based tools in ANTs (or in other packages) to derive the correspondence.
I am not getting very well how to add the landmarks. Should I take some label points in both the fixed and moving images exactly in the same positions by opening them in ITK-SNAP to get fixedImageWithLabeledLandmarks as well as movingImageWithLabeledLandmarks?
After that do I need to use ANTSUseLandmarkImagesToGetBSplineDisplacementField.exe to get the transformation?
As I read some related discussions, I need to take the transformation from it to apply to other images, but what about these fixed and moving images I used for ANTSUseLandmarkImagesToGetBSplineDisplacementField.exe
Yes, that is exactly what you need to do.
Or add the landmarks as additional Similarity terms
On Sat, Sep 28, 2019 at 5:53 PM Nick Tustison ntustison@users.sourceforge.net wrote:
brian
I couldn't save image with landmarks in ITK-SNAP. I tried it on slicer, could get landmark points but they are not saved being superimposed with images rather saved as fcsv files.
I'm not getting idea how to use that file in ANTs. Also, how to add that as additional similarity term.
Would you please suggest elaborately?
In ITK-SNAP if I save the segmentation image, it just saves the points I choose rather than the full image with the points on top of it. But when I use the image with that point sets in ANTs, it shows segmentation fault
ITK-SNAP should work. You must be doing something incorrect. Please describe how you're trying to save the segmentation image.
well, I've opened the nifti image on ITK-SNAP, used the paint brush and selected 6 points as 6 labels, then saved the segmentation image. It just saves the points. Since I'm taking fixed and moving images separately, when I ran with these images, it shows distance error. The deformation field shows nothing .
What do you mean "it just saves the points"? If you save a segmentation image in ITK-SNAP, then you end up with a segmentation image file which should have the points stored as voxels in an image.
Hi,
I am adding the steps here through images, please help me to find out my mistakes. I took 6 labels in two subjects separately (I couldn't take exact position in both of them as I'm not sure if it is possible in ITK-SNAP), saved the segmentation, then performed the follwoing operation in ANTs:
ANTSUseLandmarkImagesToGetBSplineDisplacementField untitled.nii.gz untitled1.nii.gz output 10x10x10 1 3 1
and it shows:
Distance errors:
1: 0.0662741
2: 0.027096
3: 0.0172043
4: 1.37117
5: 1.83901
6: 0.0441191
here is an example of how to do this:
https://github.com/stnava/cars
see the
cars_landmarks.R
file and the related images in the repository.brian
On Sun, Sep 29, 2019 at 11:37 AM Mumu Aktar mumuaktar@users.sourceforge.net
wrote:
Hi,
Thanks for sharing this. Unfortunately, I don't use ANTsR, I am not sure if I can use it on windows with cygwin like ANTs. But after checking car_landmarks.R I found that I should be able to directly put the fixed and moving segmentation images as input to antsRegistrationSyN.sh as initial transformation by using -r [untitled.nii.gz untitled1.nii.gz 1] but it's showing the following error:
Exception Object caught:
itk::ExceptionObject (000000000028D938)
Location: "unknown"
File: C:\Users\DP\Desktop\ANTs210\Examples..\Utilities\antsCommandLineParser.h
Line: 130
Description: itk::ERROR: CommandLineParser(000000000204F120): ERROR: Parse error occured during command line argument processing
ERROR: Unable to convert '[untitled.nii.gz' to type 'unsigned int' as unsigned int
Also, I want to solve my problems in antsUSELandmarksBSplineTransform with the images from ITK-SNAP.
Sorry to ask questions several times.
The first thing to fix is that those aren't the landmarks that the algorithm is expecting. You need point landmarks, not curves.
Hi,
I have tried later with point landmarks and the result is same.
I did it according to you but it's showing some meaningless results. I am adding my detailed steps here.
I've taken the labeled segmented images with pint landmarks from ITK-SNAP which are attached.
I've used this command to get the affine:
ANTSUseLandmarkImagesToGetAffineTransform untitled.nii.gz untitled1.nii.gz [affine] output.mat
Further, I've taken the output.mat as initialtransform to antsRegistration as below:
antsRegistration -d 3 -r output.mat -c 100x100x0 -t SyN[0.1] -m cc[im58.nii,im88.nii,1,2] -f 4x2x1 -s 2x1x0 -n NearestNeighbor -o hhff
which gives me the transformation and finally I've applied that hhff0GenenricAffine.mat to obtain the desired result by the following:
antsApplyTransforms -d 3 -r im58.nii -i im88.nii -e 0 -t hhff1Warp.nii.gz -t hhff0GenericAffine.mat -o hhff.nii
but doesn't give me the desired result:
image.png
Try breaking it down in steps. First, try just a 2-D example with only a few landmarks and see if you can get that to work. Then we can go onto the next step.
ok, I've tried with the car example's images:ford and beetle mentioned by stnava. It's 2D but in antsRegistration if I don't choose dimensionality 3, it doesn't work also! Would you please check if the steps I mentioned above is ok or not. I'm not getting idea why it's not working.