//----------------------------------------------------------------------------
void vvSlicer::UpdateDisplayExtent()
-{ //out << __func__ << endl;
-
+{
vtkImageData *input = this->GetInput();
-
if (!input || !this->ImageActor) {
return;
}
// Local copy of extent
int w_ext[6];
- int* ext = GetExtent();
+ int* ext = mImageReslice->GetOutputInformation(0)->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
copyExtent(ext, w_ext);
-
+ if (mUseReducedExtent) {
+ copyExtent(mReducedExtent, w_ext);
+ }
-
++ cout << mUseReducedExtent<< " " << w_ext[0] << " " << w_ext[1] << " " << w_ext[2] << " " << w_ext[3] << " " << w_ext[4] << " " << w_ext[5] << endl;
// Set slice value
w_ext[ this->SliceOrientation*2 ] = this->Slice;
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
- void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const int sourceExtent[6],
+ void vvSlicer::ConvertImageToImageDisplayExtent(vtkInformation *sourceImage, const int sourceExtent[6],
vtkImageData *targetImage, int targetExtent[6])
-{ //out << __func__ << endl;
+{
double dExtents[6];
+ double *origin, *spacing;
+ origin = sourceImage->Get(vtkDataObject::ORIGIN());
+ spacing = sourceImage->Get(vtkDataObject::SPACING());
for(unsigned int i=0; i<6; i++) {
// From source voxel coordinates to world coordinates
- dExtents[i] = sourceImage->GetOrigin()[i/2] + sourceImage->GetSpacing()[i/2] * sourceExtent[i];
+ dExtents[i] = origin[i/2] + spacing[i/2] * sourceExtent[i];
// From world coordinates to floating point target voxel coordinates
dExtents[i] = (dExtents[i]- targetImage->GetOrigin()[i/2]) / targetImage->GetSpacing()[i/2];
//----------------------------------------------------------------------------
void vvSlicer::Render()
-{ //out << __func__ << endl;
+{
-
if (this->mFusion && mFusionActor->GetVisibility() && showFusionLegend) {
legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable());
legend->UseOpacityOn();