Hello,
I have a program where i am loading a DICOM directory and displaying the sagittal 2d image . In that image i am using a VTKBorderWidget to select a particular region and give that region to VTKExtractVOI.
this is my code snippet:
vtkCoordinate* upperRightCoordinate =
static_cast<vtkBorderRepresentation*>(m_borderwidget_1->GetRepresentation())
->GetPosition2Coordinate();
double* upperRight;
upperRight = upperRightCoordinate->GetComputedWorldValue(m_renderer);
vtkCoordinate* lowerLeftCoordinate =
static_cast<vtkBorderRepresentation*>(m_borderwidget_1->GetRepresentation())
->GetPositionCoordinate();
double* lowerLeft;
lowerLeft = lowerLeftCoordinate->GetComputedWorldValue(m_renderer_mprwin);
Now i cannot set this directly to the extract voi as extracteddata->SetVOI(lowerLeft[0],upperRight[0],lowerLeft[1],upperRight[1],0,number_of_slices);
so i used:
voi[0] = (lowerLeft[0] - imageOrigin[0]) / imageSpacing[0]; // where imageOrigin and imageSpacing are the dicom image origin and spacing
But iam not getting the region inside the VtkBorderwidget