Open amymmorton opened 1 week ago
A few clarification points
TRA output is from pv gen- yes but they should be in AUT space.
I'm sorry - no more yellow green! oops but yes you're correct. For clarity: here is the (previously green) now blue mc1 translformed from AUT_partial volume by tra inverse
Yes- red was not modified- its the bone model of where the tiff would be with correct spatial dimensions and no translation.
What should be shown: overlay of the now blue mc1 on the bone-colored neut copy (since it's been transformed by inverse origin2dicom)
A few things
For the tra not aligining in Autoscoper
For not being able to load tras back into Slicer
Similar to your images above grey neutral is in dicom space and the white neutral is in slicer world centered space.
To create the TRA file for a PV the following steps are taken.
Slicer Centered World Space | Autoscoper Space |
---|---|
Load TIFF stack of desired volume (Origin at the world center) CT volumes were hidden for clarity.
Create a transform node from the tra file
# Small script to convert a tra file to a Slicer transform :)
# Just Copy and paste this into the slicer terminal
# Make sure to change both of the names in brackets
import numpy as np
import vtk
from itertools import product
tra = np.loadtxt(<file>, delimiter=",")
# tra = tra[0] # If there are multiple frames uncomment and change 0 to your frame
tra = tra.reshape(4,4)
mat = vtk.vtkMatrix4x4()
for i,j in product(range(4), range(4)):
mat.SetElement(i,j, tra[i,j])
tfmNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLTransformNode", <node name>)
tfmNode.SetMatrixTransformToParent(mat)
Apply the AUT2Slicer transform to the PV (Rotate 180 degress on the Yaw / Z-Axis and offset translationaly by volDim * volSpacing in the +X direction)
Apply the transform loaded in from the TRA file
The PV, its tfm and its tra need to exist in bvr and 3dct... (in cases with vrg gen and without)....
So perhaps we require camera calibration prior to allowing pv generation?
The PV, its tfm and its tra need to exist in bvr and 3dct... (in cases with vrg gen and without)....
So perhaps we require camera calibration prior to allowing pv generation?
Makes sense, I will put together a pop up that will let the user know that, for the case of the auto camera placement, they are required to run that prior to generating the PVs
Thanks, Anthony,
I will add a standalone issue for this as well, but I believe we should rearrange the pre-processing tabs, such that the segmentation and partial volumes are one after the other
Amy Morton, MSc
Sr. Research Engineer, Bioengineering Lab, Department of Orthopaedic Research The Warren Alpert Medical School of Brown University and Rhode Island Hospital 1 Hoppin Street, CORO West, Ste. 404, Providence, RI 02903
On Tue, Jun 25, 2024 at 8:13 AM Anthony Lombardi @.***> wrote:
The PV, its tfm and its tra need to exist in bvr and 3dct... (in cases with vrg gen and without)....
So perhaps we require camera calibration prior to allowing pv generation?
Makes sense, I will put together a pop up that will let the user know that, for the case of the auto camera placement, they are required to run that prior to generating the PVs
— Reply to this email directly, view it on GitHub https://github.com/BrownBiomechanics/SlicerAutoscoperM/issues/107#issuecomment-2188776109, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUUPFSYHOYBYGGM4ZM2ER3ZJFNHNAVCNFSM6AAAAABJ2FMMBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBYG43TMMJQHE . You are receiving this because you authored the thread.Message ID: @.***>
I was mistaken yesterday when I posted that the Slicer2AUT and AUT2Slicer transform were not the inverse of eachother. They are the same, I believe I was incorrectly applying the inverse of the Slicer2AUT transform originally.
I also confirmed this works with the flexion example (and double checked with the neutral example)
Load PV and CT into the scene (CT has already been centered with Dicom2Origin)
Apply Inverse Slicer2AUT transform [180 rotation about the x axis and an offset of size volDim*volspacing in the +X direction]
Apply the tra as loaded from Autoscoper
bone coloured volume rendering is a clone of neutral, with invert Origin2DICOM applied.
Yellow segmented stls
Grey - neutral volume rendering (dciom space)
Green in mc1 with (invert) tra applied