BrownBiomechanics / Autoscoper

Autoscoper is a 2D-3D image registration software package.
https://autoscoper.readthedocs.io
Other
8 stars 5 forks source link

Improve documentation related to how Autoscoper loads volumes into its world space. #280

Open NicerNewerCar opened 5 months ago

NicerNewerCar commented 5 months ago

See this comment https://github.com/BrownBiomechanics/SlicerAutoscoperM/pull/97#discussion_r1607190023

https://github.com/BrownBiomechanics/Autoscoper/blob/8fe9748ab0680955a8c18015009eff0cb457e29a/libautoscoper/src/Volume.cpp#L107-L139

https://github.com/BrownBiomechanics/Autoscoper/blob/8fe9748ab0680955a8c18015009eff0cb457e29a/libautoscoper/src/TiffImage.cpp#L115-L162

NicerNewerCar commented 5 months ago

Loading in the same volume in both Autoscoper and Slicer. Both are placed at the origin. Autoscoper: Red: +X, Green: +Y, Blue: +Z. Origin is at the center of the XZ plane pictured. Slicer: R: +X, A: +Y, S +Z. Origin is denoted by the red markup. I tried to get similar angles (relative to the axes) for the screenshots. After the Y/Z Flip the volume, within slicer, is now in the same orientation as the volume in Autoscoper, just on the wrong side of the origin. So we can apply an offset in the X direction to account for this.

Autoscoper Slicer
Loaded in image image
Flip Y/Z in Slicer image image
X offset image image
NicerNewerCar commented 4 months ago

@amymmorton @jcfr Starting to workshop a diagram to showcase all of the transforms within the pre-processing module. This will be followed up with a brief summary of what each transform is and where it gets generated. image

A couple of changes that will need to go in for this:

Let me know if there is anything else you would like to see.

I also had a couple of questions:

  1. Where this should reside within the RTD? I was thinking under the advanced topics category.
  2. Standardize on 2 or To?
  3. Are all of the space names okay? Slicer, Dicom, {volumeName}, Autoscoper Or did you have any other suggestions?
amymmorton commented 4 months ago

We need to make sure that we are consitent with previous bvr processing and scalable to 3dct/4dct.

Historical bvr:
established -{volumeName}.tfm == partial volume tiff stacks to their dicom origin -{pose_volumeName}.tra == transform of {AUT_volumeName} model file(representative of partialvolume) from AUTCS to optimized location in target frame

*established -- but not yet created in preprocessing flow:

y_sz = size(volumeName.tif,1) * inv(volumeName.tfm)(1,1) ; CT_to_AUT_4x4 = RT_to_fX4(eul2rotm([0,0,pi]),[0 y_sz 0]); {AUT_volumeName}.stl = RT_transform(PVOL_volumeName.stl, CT_to_AUT_4x4(1:3,1:3), CT_to_AUT_4x4(1:3,4),1);

where PVOL_volumeName.stl == segmented volumeName.stl in dicom space * 'translation from inv(volumeName.tfm)

The additional complexity of the vrgs has to be compatible with this bvr cs convention