Commit c6a6ac55 authored by Sebastien Barre's avatar Sebastien Barre
Browse files

ENH: need to get min slice number too

parent ad66d2e3
......@@ -20,7 +20,7 @@
#include "vtkRenderer.h"
#include "vtkTransform.h"
vtkCxxRevisionMacro(vtkImageActor, "1.22");
vtkCxxRevisionMacro(vtkImageActor, "1.23");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......@@ -105,6 +105,30 @@ int vtkImageActor::GetSliceNumberMax()
return wextent[5];
}
//----------------------------------------------------------------------------
int vtkImageActor::GetSliceNumberMin()
{
if (!this->GetInput())
{
return 0;
}
this->GetInput()->UpdateInformation();
int *wextent = this->GetInput()->GetWholeExtent();
// find the first axis with a one pixel extent and return
// its value
if (this->ComputedDisplayExtent[0] == this->ComputedDisplayExtent[1])
{
return wextent[0];
}
if (this->ComputedDisplayExtent[2] == this->ComputedDisplayExtent[3])
{
return wextent[2];
}
return wextent[4];
}
//----------------------------------------------------------------------------
void vtkImageActor::SetDisplayExtent(int extent[6])
{
......
......@@ -91,10 +91,11 @@ public:
void GetDisplayBounds(double bounds[6]);
// Description:
// Return the slice number (and max slice number) computed from the display
// Return the slice number (& min/max slice number) computed from the display
// extent.
int GetSliceNumber();
int GetSliceNumberMax();
int GetSliceNumberMin();
//BTX
// Description:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment