Closed archanasri closed 4 years ago
@sheryjoe any suggestions?
What should resize do? Based on the name, it should only "resize", i.e, scale, the given image to a given logical size, or voxel spacing. Applying the transformation to an image is different. If ICP is setting the image size to the reference image, this means that ICP is already applying (via a resample and transformation filters) the transformation matrix. To keep modularity, this should translate to an icp command that only computes the transformation matrix and an "apply" or "resample" command that takes in the transformation matrix and apply it to the image.
I don't think that icp in groom utils is returning the transformation matrix for the purpose of applying it, rather keeping track of the transformation applied to the segmentations either to provide a way back to the original (given) coordinate system and/or apply the same transformation to the corresponding image data.
That’s exactly what it does. The command line version, which calls the imo still far too specialized (I always say “idiosyncratic” with a negative implication, but we’re all special, right?) ImageUtils function. It wraps this functionality. The python wrapped api will not require this much and make the operation more transparent.
...which I’m the case of the past unmeasurable amount of time of using this executable has been exactly a resize and nothing else.
On Mon, Aug 3, 2020 at 6:06 PM Shireen Elhabian notifications@github.com wrote:
What should resize do? Based on the name, it should only "resize", i.e, scale, the given image to a given logical size, or voxel spacing. Applying the transformation to an image is different. If ICP is setting the image size to the reference image, this means that ICP is already applying (via a resample and transformation filters) the transformation matrix. To keep modularity, this should translate to an icp command that only computes the transformation matrix and an "apply" or "resample" command that takes in the transformation matrix and apply it to the image.
I don't think that icp in groom utils is returning the transformation matrix for the purpose of applying it, rather keeping track of the transformation applied to the segmentations either to provide a way back to the original (given) coordinate system and/or apply the same transformation to the corresponding image data.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SCIInstitute/ShapeWorks/issues/653#issuecomment-668299398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJT3EMP5ONC4GY2DICBJZDR65GIJANCNFSM4PT2OSLA .
Let's conduct some tests w/ and w/o the icp alignment step w/ LA. 1a. ask whether the images seem more aligned or not 1b. compare final results and try to understand why using this transform makes them worse (we think it did)
2a. Try to manually modify the data to see if there's any benefit even when the data are more out of line (30 degrees) 2b. compare results
@AtefehKashani From what I understand, ICP is just a standalone command that is used outside of GroomUtils for down the road tasks for the current use cases. For use cases like the right ventricle, we would need ICP in GroomUtils. Is that right?
@archanasri ICP is a standalone command, but we need to keep it in the GroomUtils. It should be applied before cropping and optimization, please don't exclude it from GroomUtils. All I am saying is that, you may not notice its effect for some data sets like LA, but for other data set like VR it is essential.
@AtefehKashani When the correct ICP is used for the ellipsoid use case, it produces bad results.
What's the precise cause of this? Is it due to the combination of the low resolution of the ellipsoid images and the resampling? Are we performing this step on binary segmentations or distance transforms? If the former, are we using a nearest neighbor interpolation or perfoming a binarize operation? Neither will be ideal.
@akenmorris We are performing this on binary segmentations with a nearest neighbor interpolation.
I wouldn’t be surprised at the result then. I don’t think the ICP tool should be used in this way.
@akenmorris What about using a linear interpolation?
I don't think that will make a difference in our current pipeline. Later on, I see an extractLabel(1.0) call that will effectively binarize the result.
ICP works as advertised. We should use Image::resample instead of Image::resize in order to correctly resolve the LA fix in pull request #651 (details in #659 and #661 which will be resolved on the shapeworks_improv branch containing the LA fix pull).
The more general issue of not applying transforms until the last minute is now issue #660. It includes many other functions besides ICP.
I am therefore closing this issue.
The transformation matrix created by ICP is not used in GroomUtils but ICP takes care of setting all the image sizes to that of the reference (target) image which is important for the next step (cropping) of the grooming process. For now, this is taken care of by the resize command but the underlying issue needs to be fixed.