From: tbaudier Date: Tue, 15 Dec 2015 10:33:07 +0000 (+0100) Subject: Merge branch 'VTK6_Qt5_Registration' into VTK6_Qt5 X-Git-Tag: v1.4.0~83 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6d66b6a238133e2e237e792e46b27c6e71227d78;p=clitk.git Merge branch 'VTK6_Qt5_Registration' into VTK6_Qt5 --- 6d66b6a238133e2e237e792e46b27c6e71227d78 diff --cc vv/vvSlicer.cxx index 575fdac,63d4699..57500bb --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@@ -1071,9 -1070,9 +1070,8 @@@ int vvSlicer::GetOrientation( //---------------------------------------------------------------------------- void vvSlicer::UpdateDisplayExtent() -{ //out << __func__ << endl; - +{ vtkImageData *input = this->GetInput(); - if (!input || !this->ImageActor) { return; } @@@ -1085,9 -1086,12 +1085,12 @@@ // 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; @@@ -1250,13 -1229,16 +1228,16 @@@ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- - 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]; @@@ -1595,8 -1577,7 +1576,7 @@@ double vvSlicer::GetScalarComponentAsDo //---------------------------------------------------------------------------- void vvSlicer::Render() -{ //out << __func__ << endl; +{ - if (this->mFusion && mFusionActor->GetVisibility() && showFusionLegend) { legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable()); legend->UseOpacityOn();