vtk - Know slice number? -
I have a DICOM series with the following original, spacing and range:
int NExtent [6]; Double despection [3]; Double daugin [3]; M_pReader-> GetOutputInformation (0) - & gt; Go (vtkStreamingDemandDrivenPipeline :: WHOLE_EXTENT (), nExtent); M_pReader-> GetOutput () - & gt; GetSpacing (dSpacing); M_pReader-> GetOutput () - & gt; GetOrigin (dOrigin); Where m_pReader is a vtkDICOMReader object ...
degrade 0, 0, 0;
DSPIID ID 0.447266, 0.447266, 3. 998718;
nExtent is 0, 511, 0, 511, 0, 43;
The series is axial now, if I slice the chain through the axial scheme, then I can split the series with 44 slices, such as:
Double delta = 0.0; Delta + = 1.0; PReslice-> Updates (); Double dSliceSpacing = pReslice-> GetOutput () - & gt; GetSpacing () [2]; VtkMatrix4x4 * pMatrix = pReslice-> GetResliceAxes (); // Transfer to Disentant Deportes that we are smashing through Double Depot [4]; Double Dee Center [4]; DPoint [0] = 0.0; DEPUT [1] = 0.0; DEPUT [2] = DSLICI Spacing * Delta; DEPUT [3] = 1.0; PMatrix-> Multipoint (dPoint, dCenter); PMatrix-> Set aliment (0, 3, de center [0]); PMatrix-> Set aliment (1, 3, de center [1]); PMatrix-> Set aliment (2, 3, denter [2]); Everything is fine ...
Problem: If I slice the chain through the coronal plan, slices are not 44 !! But how many people? If Coronal or Sagittal is planned then how can I know the slice number?
For example
For example < / P>
For example, for each axis (X, Y, Z) you need to calculate your minimum / maximum origin
myOriginMax.x = myOrigin.X + ((ImageDimension.SizeX - 1) * mySpacing.X); You can calculate your new origin at your slicing event, where _positionDelta is your inc / dec value. (More or less proxy code)
e.g.
double [] _origin = myImageReslice.GetResliceAxesOrigin (); If (_view == "segel") {_origin [0] = monastery (_origin [0] + _position_delata * mySpacing.X, myOriginMax.x); } And if (_view == "coronal") {_origin [1] = monastery (_origin [1] + _position delta * mySpacing.Y, myOriginMax.Y); } And // XAC {_origin [2] = Math.min (_origin [2] + _positionDelta * mySpacing.Z, myOriginMax.Z); } MyImageReslice.SetReliceAxesOrigin (_origin [0], _origin [1], _origin [2]); to present();
Comments
Post a Comment