1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
21 #include "vvSlicerManagerCommand.h"
22 #include "vvGlyphSource.h"
23 #include "vvGlyph2D.h"
24 #include "vvImageMapToWLColors.h"
26 #include <vtkTextProperty.h>
27 #include <vtkTextActor.h>
28 #include <vtkTextSource.h>
29 #include <vtkActor2D.h>
30 #include <vtkCursor2D.h>
31 #include <vtkPolyDataMapper2D.h>
32 #include <vtkProperty2D.h>
33 #include <vtkCornerAnnotation.h>
34 #include <vtkImageMapToWindowLevelColors.h>
35 #include <vtkImageData.h>
36 #include <vtkImageActor.h>
37 #include <vtkToolkits.h>
38 #include <vtkObjectFactory.h>
39 #include <vtkPointData.h>
40 #include <vtkDataArray.h>
41 #include <vtkFloatArray.h>
42 #include <vtkClipPolyData.h>
43 #include <vtkGlyph3D.h>
45 #include <vtkCursor3D.h>
46 #include <vtkProperty.h>
48 #include <vtkLightCollection.h>
49 #include <vtkScalarBarActor.h>
50 #include <vtkLookupTable.h>
52 #include <vtkRenderer.h>
53 #include <vtkRendererCollection.h>
54 #include <vtkRenderWindow.h>
55 #include <vtkRenderWindowInteractor.h>
56 #include <vtkCamera.h>
57 #include <vtkCallbackCommand.h>
58 #include <vtkCommand.h>
59 #include <vtkPolyDataMapper.h>
62 #include <vtkExtractVOI.h>
63 #include <vtkSphereSource.h>
64 #include <vtkCutter.h>
65 #include <vtkAssignAttribute.h>
66 #include <vtkImageAccumulate.h>
67 #include <vtkImageReslice.h>
69 vtkCxxRevisionMacro(vvSlicer, "DummyRevision");
70 vtkStandardNewMacro(vvSlicer);
72 //------------------------------------------------------------------------------
77 mUseReducedExtent = false;
79 mCurrent[0] = -VTK_DOUBLE_MAX;
80 mCurrent[1] = -VTK_DOUBLE_MAX;
81 mCurrent[2] = -VTK_DOUBLE_MAX;
83 mCursor[0] = -VTK_DOUBLE_MAX;
84 mCursor[1] = -VTK_DOUBLE_MAX;
85 mCursor[2] = -VTK_DOUBLE_MAX;
86 mCursor[3] = -VTK_DOUBLE_MAX;
93 std::string text = "F1 = sagital; F2 = coronal; F3 = axial\n";
94 text += "F5 = horizontal flip; F6 = vertical flip\n\n";
95 text += "0,1,2,3,4,5 : preset windowing\n";
96 text += "6,7,8,9 : preset colormap\n";
97 text += "z : local windowing\n";
98 text += "r : reset view\n";
99 text += "l : reload image\n";
100 text += "f : fly to mouse position\n";
101 text += "g : go to cross hair position\n\n";
102 text += "Up,down : change slice\n";
103 text += "Left,right : change tenporal slice\n\n";
104 text += "Scrollbar (or w/x) : zoom in/out\n";
105 text += "left button : synchronize all views\n";
106 text += "middle button : grab image\n";
107 text += "right button : change windowing\n";
109 crossCursor = vtkCursor2D::New();
110 crossCursor->AllOff();
111 crossCursor->AxesOn();
112 crossCursor->SetTranslationMode(1);
113 crossCursor->SetRadius(2);
115 pdm = vtkPolyDataMapper2D::New();
116 pdm->SetInput(crossCursor->GetOutput());
118 pdmA = vtkActor2D::New();
119 pdmA->SetMapper(pdm);
120 pdmA->GetProperty()->SetColor(255,10,212);
121 pdmA->SetVisibility(0);
122 pdmA->SetPickable(0);
124 ca = vtkCornerAnnotation::New();
125 ca->GetTextProperty()->SetColor(255,10,212);
126 ca->SetVisibility(1);
134 legend = vtkSmartPointer<vtkScalarBarActor>::New();
135 //legend->SetTitle("test!");
136 legend->SetPosition(0.82,0.18);
137 legend->SetWidth(0.1);
138 legend->SetVisibility(0);
139 legend->SetLabelFormat("%.1f");
140 this->GetRenderer()->AddActor(legend);
142 this->WindowLevel->Delete();
143 this->WindowLevel = vvImageMapToWLColors::New();
144 this->InstallPipeline();
147 //------------------------------------------------------------------------------
150 //------------------------------------------------------------------------------
151 vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper() {
152 return mOverlayMapper.GetPointer();
154 //------------------------------------------------------------------------------
157 //------------------------------------------------------------------------------
158 vtkImageActor* vvSlicer::GetOverlayActor() {
159 return mOverlayActor.GetPointer();
161 //------------------------------------------------------------------------------
164 //------------------------------------------------------------------------------
165 vtkImageMapToWindowLevelColors* vvSlicer::GetFusionMapper() {
166 return mFusionMapper.GetPointer();
168 //------------------------------------------------------------------------------
171 //------------------------------------------------------------------------------
172 vtkImageActor* vvSlicer::GetFusionActor() {
173 return mFusionActor.GetPointer();
175 //------------------------------------------------------------------------------
178 //------------------------------------------------------------------------------
179 vtkActor* vvSlicer::GetVFActor() {
180 return mVFActor.GetPointer();
182 //------------------------------------------------------------------------------
185 //------------------------------------------------------------------------------
186 vtkCornerAnnotation* vvSlicer::GetAnnotation() {
187 return ca.GetPointer();
189 //------------------------------------------------------------------------------
192 //------------------------------------------------------------------------------
193 void vvSlicer::EnableReducedExtent(bool b) {
194 mUseReducedExtent = b;
196 //------------------------------------------------------------------------------
199 //------------------------------------------------------------------------------
200 void vvSlicer::SetReducedExtent(int * ext) {
201 mReducedExtent = ext;
203 //------------------------------------------------------------------------------
206 //------------------------------------------------------------------------------
207 void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate)
210 mSurfaceCutActors.push_back(new vvMeshActor());
212 mSurfaceCutActors.back()->Init(contour,mCurrentTSlice,mVF);
214 mSurfaceCutActors.back()->Init(contour,mCurrentTSlice);
215 mSurfaceCutActors.back()->SetSlicingOrientation(SliceOrientation);
216 this->GetRenderer()->AddActor(mSurfaceCutActors.back()->GetActor());
220 //------------------------------------------------------------------------------
223 //------------------------------------------------------------------------------
224 void vvSlicer::ToggleContourSuperposition()
226 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
227 i!=mSurfaceCutActors.end();i++)
228 (*i)->ToggleSuperposition();
230 //------------------------------------------------------------------------------
233 //------------------------------------------------------------------------------
234 void vvSlicer::SetCursorColor(int r,int g, int b)
236 pdmA->GetProperty()->SetColor(r,g,b);
238 //------------------------------------------------------------------------------
241 //------------------------------------------------------------------------------
242 void vvSlicer::SetCursorVisibility(bool s)
244 pdmA->SetVisibility(s);
246 //------------------------------------------------------------------------------
249 //------------------------------------------------------------------------------
250 bool vvSlicer::GetCursorVisibility()
252 return pdmA->GetVisibility();
254 //------------------------------------------------------------------------------
257 //------------------------------------------------------------------------------
258 vvSlicer::~vvSlicer()
260 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
261 i!=mSurfaceCutActors.end();i++)
264 //------------------------------------------------------------------------------
267 //------------------------------------------------------------------------------
268 void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
275 //------------------------------------------------------------------------------
278 //------------------------------------------------------------------------------
279 void vvSlicer::SetImage(vvImage::Pointer image)
281 if (image->GetVTKImages().size())
284 this->Superclass::SetInput(image->GetVTKImages()[0]);
286 // Prevent crash when reload -> change slice if outside extent
288 this->GetInput()->GetWholeExtent(extent);
289 if (SliceOrientation == 0) {
290 if (Slice >= extent[1]) {
291 Slice = (extent[1]-extent[0])/2.0;
294 if (SliceOrientation == 1) {
295 if (Slice >= extent[3]) {
296 Slice = (extent[3]-extent[2])/2.0;
299 if (SliceOrientation == 2) {
300 if (Slice >= extent[5]) {
301 Slice = (extent[5]-extent[4])/2.0;
305 this->UpdateDisplayExtent();
307 ca->SetText(0,mFileName.c_str());
310 //------------------------------------------------------------------------------
313 //------------------------------------------------------------------------------
314 void vvSlicer::SetOverlay(vvImage::Pointer overlay)
316 if (overlay->GetVTKImages().size())
321 mOverlayMapper = vtkImageMapToWindowLevelColors::New();
322 mOverlayMapper->SetInput(overlay->GetVTKImages()[0]);
326 mOverlayActor = vtkImageActor::New();
327 mOverlayActor->SetInput(mOverlayMapper->GetOutput());
328 mOverlayActor->SetPickable(0);
329 mOverlayActor->SetVisibility(false);
330 mOverlayActor->SetOpacity(0.5);
331 this->UpdateDisplayExtent();
334 //stupid but necessary : the Overlay need to be rendered before fusion
337 this->GetRenderer()->RemoveActor(mFusionActor);
338 this->GetRenderer()->AddActor(mOverlayActor);
339 this->GetRenderer()->AddActor(mFusionActor);
342 this->GetRenderer()->AddActor(mOverlayActor);
345 SetTSlice(mCurrentTSlice);
348 //------------------------------------------------------------------------------
351 //------------------------------------------------------------------------------
352 void vvSlicer::SetFusion(vvImage::Pointer fusion)
354 if (fusion->GetVTKImages().size())
359 mFusionMapper = vtkImageMapToWindowLevelColors::New();
360 mFusionMapper->SetInput(fusion->GetVTKImages()[0]);
364 mFusionActor = vtkImageActor::New();
365 mFusionActor->SetInput(mFusionMapper->GetOutput());
366 mFusionActor->SetPickable(0);
367 mFusionActor->SetVisibility(false);
368 mFusionActor->SetOpacity(0.7);
369 this->UpdateDisplayExtent();
370 this->GetRenderer()->AddActor(mFusionActor);
374 SetTSlice(mCurrentTSlice);
377 //------------------------------------------------------------------------------
380 //------------------------------------------------------------------------------
381 void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis)
383 if (actor_type == "vector")
385 this->mVFActor->SetVisibility(vis);
387 if (actor_type == "overlay")
389 this->mOverlayActor->SetVisibility(vis);
391 if (actor_type == "fusion")
393 this->mFusionActor->SetVisibility(vis);
395 if (actor_type == "contour")
396 this->mSurfaceCutActors[overlay_index]->GetActor()->SetVisibility(vis);
397 UpdateDisplayExtent();
399 //------------------------------------------------------------------------------
402 //------------------------------------------------------------------------------
403 void vvSlicer::SetVF(vvImage::Pointer vf)
405 if (vf->GetVTKImages().size())
411 mAAFilter=vtkAssignAttribute::New();
412 mVOIFilter = vtkExtractVOI::New();
413 mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
415 mVOIFilter->SetInput(vf->GetVTKImages()[0]);
416 mAAFilter->SetInput(mVOIFilter->GetOutput());
417 ///This tells VTK to use the scalar (pixel) data of the image to draw the little arrows
418 mAAFilter->Assign(vtkDataSetAttributes::SCALARS, vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA);
421 mArrow = vvGlyphSource::New();
422 mArrow->SetGlyphTypeToSpecificArrow();
423 mArrow->SetScale(mScale);
426 // Glyph the gradient vector (with arrows)
428 mGlyphFilter = vvGlyph2D::New();
429 mGlyphFilter->SetInput(mAAFilter->GetOutput());
430 mGlyphFilter->SetSource(mArrow->GetOutput());
431 mGlyphFilter->ScalingOn();
432 mGlyphFilter->SetScaleModeToScaleByVector();
433 mGlyphFilter->OrientOn();
434 mGlyphFilter->SetVectorModeToUseVector();
435 mGlyphFilter->SetColorModeToColorByVector();
438 mVFMapper = vtkPolyDataMapper::New();
439 //mVFMapper->SetInputConnection(mGlyphFilter->GetOutputPort());
440 mVFMapper->SetInput(mGlyphFilter->GetOutput());
441 mVFMapper->ImmediateModeRenderingOn();
444 mVFActor = vtkActor::New();
445 mVFActor->SetMapper(mVFMapper);
446 mVFActor->SetPickable(0);
447 mVFActor->GetProperty()->SetLineWidth(mVFWidth);
448 this->UpdateDisplayExtent();
449 this->GetRenderer()->AddActor(mVFActor);
452 SetTSlice(mCurrentTSlice);
455 //------------------------------------------------------------------------------
458 //------------------------------------------------------------------------------
459 void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
461 mLandmarks = landmarks;
466 mCross = vtkCursor3D::New();
467 mCross->SetFocalPoint(0.0,0.0,0.0);
468 mCross->SetModelBounds(-10,10,-10,10,-10,10);
473 mLandGlyph = vtkGlyph3D::New();
474 mLandGlyph->SetSource(mCross->GetOutput());
475 mLandGlyph->SetInput(landmarks->GetOutput());
476 //mLandGlyph->SetIndexModeToScalar();
477 mLandGlyph->SetRange(0,1);
478 mLandGlyph->ScalingOff();
480 mLandGlyph->SetColorModeToColorByScalar();
483 mClipBox = vtkBox::New();
485 mLandClipper = vtkClipPolyData::New();
486 mLandClipper->InsideOutOn();
487 mLandClipper->SetInput(mLandGlyph->GetOutput());
488 mLandClipper->SetClipFunction(mClipBox);
491 mLandMapper = vtkPolyDataMapper::New();
492 mLandMapper->SetInputConnection(mLandClipper->GetOutputPort());
493 //mLandMapper->ScalarVisibilityOff();
496 mLandActor = vtkActor::New();
497 mLandActor->SetMapper(mLandMapper);
498 mLandActor->GetProperty()->SetColor(255,10,212);
499 mLandActor->SetPickable(0);
500 mLandActor->SetVisibility(true);
501 this->UpdateDisplayExtent();
502 this->GetRenderer()->AddActor(mLandActor);
505 //------------------------------------------------------------------------------
507 //------------------------------------------------------------------------------
508 //FIXME: this function leaks memory, we should fix it someday :)
509 void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
511 if (actor_type == "vector")
513 Renderer->RemoveActor(mVFActor);
522 if (actor_type == "overlay")
524 Renderer->RemoveActor(mOverlayActor);
526 mOverlayActor = NULL;
527 mOverlayMapper = NULL;
529 if (actor_type == "fusion")
531 Renderer->RemoveActor(mFusionActor);
534 mFusionMapper = NULL;
536 if (actor_type == "contour")
538 Renderer->RemoveActor(this->mSurfaceCutActors[overlay_index]->GetActor());
539 mSurfaceCutActors.erase(mSurfaceCutActors.begin()+overlay_index);
542 //------------------------------------------------------------------------------
545 //------------------------------------------------------------------------------
546 void vvSlicer::SetVFSubSampling(int sub)
550 mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
553 UpdateDisplayExtent();
556 //------------------------------------------------------------------------------
559 //------------------------------------------------------------------------------
560 void vvSlicer::SetVFScale(int scale)
564 mArrow->SetScale(mScale);
565 UpdateDisplayExtent();
568 //------------------------------------------------------------------------------
570 //------------------------------------------------------------------------------
571 void vvSlicer::SetVFWidth(int width)
575 mVFActor->GetProperty()->SetLineWidth(mVFWidth);
576 UpdateDisplayExtent();
579 //------------------------------------------------------------------------------
582 //------------------------------------------------------------------------------
583 void vvSlicer::SetVFLog(int log)
588 mGlyphFilter->SetUseLog(mVFLog);
589 mGlyphFilter->Modified();
591 UpdateDisplayExtent();
594 //------------------------------------------------------------------------------
597 //------------------------------------------------------------------------------
598 void vvSlicer::SetTSlice(int t)
602 else if ((unsigned int)t >= mImage->GetVTKImages().size())
603 t = mImage->GetVTKImages().size() -1;
605 if (mCurrentTSlice == t) return;
608 this->SetInput(mImage->GetVTKImages()[t]);
609 if (mVF && mVFActor->GetVisibility())
611 if (mVF->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
612 mVOIFilter->SetInput(mVF->GetVTKImages()[mCurrentTSlice]);
614 if (mOverlay && mOverlayActor->GetVisibility())
616 if (mOverlay->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
617 mOverlayMapper->SetInput(mOverlay->GetVTKImages()[mCurrentTSlice]);
619 if (mFusion && mFusionActor->GetVisibility())
621 if (mFusion->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
622 mFusionMapper->SetInput(mFusion->GetVTKImages()[mCurrentTSlice]);
624 if (mSurfaceCutActors.size() > 0)
625 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
626 i!=mSurfaceCutActors.end();i++)
627 (*i)->SetTimeSlice(mCurrentTSlice);
628 UpdateDisplayExtent();
630 //------------------------------------------------------------------------------
633 //------------------------------------------------------------------------------
634 int vvSlicer::GetTSlice()
636 return mCurrentTSlice;
638 //------------------------------------------------------------------------------
641 //------------------------------------------------------------------------------
642 void vvSlicer::SetSliceOrientation(int orientation)
644 //if 2D image, force to watch in Axial View
646 this->GetInput()->GetWholeExtent(extent);
647 if (extent[5]-extent[4] <= 2)
650 if (orientation < vtkImageViewer2::SLICE_ORIENTATION_YZ ||
651 orientation > vtkImageViewer2::SLICE_ORIENTATION_XY)
653 vtkErrorMacro("Error - invalid slice orientation " << orientation);
657 this->SliceOrientation = orientation;
660 int *range = this->GetSliceRange();
662 this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
664 this->UpdateOrientation();
665 this->UpdateDisplayExtent();
667 if (this->Renderer && this->GetInput())
669 double scale = this->Renderer->GetActiveCamera()->GetParallelScale();
670 this->Renderer->ResetCamera();
671 this->Renderer->GetActiveCamera()->SetParallelScale(scale);
676 //----------------------------------------------------------------------------
679 //----------------------------------------------------------------------------
680 int * vvSlicer::GetExtent() {
682 if (mUseReducedExtent) {
683 w_ext = mReducedExtent;
685 else w_ext = GetInput()->GetWholeExtent();
688 //----------------------------------------------------------------------------
691 //----------------------------------------------------------------------------
692 int vvSlicer::GetOrientation() {
693 return this->SliceOrientation;
695 //----------------------------------------------------------------------------
698 //----------------------------------------------------------------------------
699 void vvSlicer::UpdateDisplayExtent()
701 vtkImageData *input = this->GetInput();
702 if (!input || !this->ImageActor)
706 input->UpdateInformation();
707 int *w_ext;// = input->GetWholeExtent();
709 if (mUseReducedExtent) {
710 w_ext = mReducedExtent;
712 else w_ext = input->GetWholeExtent();
714 switch (this->SliceOrientation)
716 case vtkImageViewer2::SLICE_ORIENTATION_XY:
717 this->ImageActor->SetDisplayExtent(
718 w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice);
719 if (mVF && mVFActor->GetVisibility())
722 ComputeVFDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,vfExtent);
723 mVOIFilter->SetVOI(vfExtent);
724 mGlyphFilter->SetOrientation(1,1,0);
726 // put the vector field between the image and the camera
727 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
728 mVFActor->SetPosition(0,0,ImageActor->GetBounds()[5]+2);
730 mVFActor->SetPosition(0,0,ImageActor->GetBounds()[4]-2);
732 if (mOverlay && mOverlayActor->GetVisibility())
735 ComputeOverlayDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,overExtent);
736 mOverlayActor->SetDisplayExtent(overExtent);
737 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
738 mOverlayActor->SetPosition(0,0,1);
740 mOverlayActor->SetPosition(0,0,-1);
742 if (mFusion && mFusionActor->GetVisibility())
745 ComputeFusionDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,fusExtent);
746 mFusionActor->SetDisplayExtent(fusExtent);
747 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
748 mFusionActor->SetPosition(0,0,1.5);
750 mFusionActor->SetPosition(0,0,-1.5);
757 bounds[0] = ImageActor->GetBounds()[0];
758 bounds[1] = ImageActor->GetBounds()[1];
759 bounds[2] = ImageActor->GetBounds()[2];
760 bounds[3] = ImageActor->GetBounds()[3];
761 bounds[4] = ImageActor->GetBounds()[4]-(0.9/this->GetInput()->GetSpacing()[2]);
762 bounds[5] = ImageActor->GetBounds()[5]+(0.9/this->GetInput()->GetSpacing()[2]);
763 mClipBox->SetBounds(bounds);
766 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
767 mLandActor->SetPosition(0,0,1.5);
769 mLandActor->SetPosition(0,0,-1.5);
773 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
774 this->ImageActor->SetDisplayExtent(
775 w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5]);
776 if (mVF && mVFActor->GetVisibility())
779 ComputeVFDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],vfExtent);
780 mVOIFilter->SetVOI(vfExtent);
781 mGlyphFilter->SetOrientation(1,0,1);
783 // put the vector field between the image aSpacingnd the camera
784 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
785 mVFActor->SetPosition(0,ImageActor->GetBounds()[3]+2,0);
787 mVFActor->SetPosition(0,ImageActor->GetBounds()[2]-2,0);
789 if (mOverlay && mOverlayActor->GetVisibility())
792 ComputeOverlayDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],overExtent);
793 mOverlayActor->SetDisplayExtent(overExtent);
794 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
795 mOverlayActor->SetPosition(0,1,0);
797 mOverlayActor->SetPosition(0,-1,0);
799 if (mFusion && mFusionActor->GetVisibility())
802 ComputeFusionDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],fusExtent);
803 mFusionActor->SetDisplayExtent(fusExtent);
804 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
805 mFusionActor->SetPosition(0,1.5,0);
807 mFusionActor->SetPosition(0,-1.5,0);
814 bounds[0] = ImageActor->GetBounds()[0];
815 bounds[1] = ImageActor->GetBounds()[1];
816 bounds[2] = ImageActor->GetBounds()[2]-(0.5/this->GetInput()->GetSpacing()[1]);
817 bounds[3] = ImageActor->GetBounds()[3]+(0.5/this->GetInput()->GetSpacing()[1]);
818 bounds[4] = ImageActor->GetBounds()[4];
819 bounds[5] = ImageActor->GetBounds()[5];
820 mClipBox->SetBounds(bounds);
823 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
824 mLandActor->SetPosition(0,1.5,0);
826 mLandActor->SetPosition(0,-1.5,0);
830 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
831 this->ImageActor->SetDisplayExtent(
832 this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
833 if (mVF && mVFActor->GetVisibility())
836 ComputeVFDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],vfExtent);
837 mVOIFilter->SetVOI(vfExtent);
838 mGlyphFilter->SetOrientation(0,1,1);
840 // put the vector field between the image and the camera
841 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
842 mVFActor->SetPosition(ImageActor->GetBounds()[1]+2,0,0);
844 mVFActor->SetPosition(ImageActor->GetBounds()[0]-2,0,0);
846 if (mOverlay && mOverlayActor->GetVisibility())
849 ComputeOverlayDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],overExtent);
850 mOverlayActor->SetDisplayExtent(overExtent);
851 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
852 mOverlayActor->SetPosition(1,0,0);
854 mOverlayActor->SetPosition(-1,0,0);
856 if (mFusion && mFusionActor->GetVisibility())
859 ComputeFusionDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],fusExtent);
860 mFusionActor->SetDisplayExtent(fusExtent);
861 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
862 mFusionActor->SetPosition(1.5,0,0);
864 mFusionActor->SetPosition(-1.5,0,0);
871 bounds[0] = ImageActor->GetBounds()[0]-(0.5/this->GetInput()->GetSpacing()[0]);
872 bounds[1] = ImageActor->GetBounds()[1]+(0.5/this->GetInput()->GetSpacing()[0]);
873 bounds[2] = ImageActor->GetBounds()[2];
874 bounds[3] = ImageActor->GetBounds()[3];
875 bounds[4] = ImageActor->GetBounds()[4];
876 bounds[5] = ImageActor->GetBounds()[5];
877 mClipBox->SetBounds(bounds);
880 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
881 mLandActor->SetPosition(1.5,0,0);
883 mLandActor->SetPosition(-1.5,0,0);
888 // Figure out the correct clipping range
892 if (this->InteractorStyle &&
893 this->InteractorStyle->GetAutoAdjustCameraClippingRange())
895 this->Renderer->ResetCameraClippingRange();
899 vtkCamera *cam = this->Renderer->GetActiveCamera();
903 this->ImageActor->GetBounds(bounds);
904 double spos = (double)bounds[this->SliceOrientation * 2];
905 double cpos = (double)cam->GetPosition()[this->SliceOrientation];
906 double range = fabs(spos - cpos);
907 double *spacing = input->GetSpacing();
909 ((double)spacing[0] + (double)spacing[1] + (double)spacing[2]) / 3.0;
910 cam->SetClippingRange(
911 range - avg_spacing * 3.0, range + avg_spacing * 3.0);
916 //----------------------------------------------------------------------------
919 //----------------------------------------------------------------------------
920 void vvSlicer::ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int vfExtent[6])
922 vtkImageData* image=this->GetInput();
923 vfExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mVF->GetOrigin()[0]) /
924 mVF->GetSpacing()[0];
925 vfExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mVF->GetOrigin()[0]) /
926 mVF->GetSpacing()[0];
927 vfExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mVF->GetOrigin()[1]) /
928 mVF->GetSpacing()[1];
929 vfExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mVF->GetOrigin()[1]) /
930 mVF->GetSpacing()[1];
931 vfExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mVF->GetOrigin()[2]) /
932 mVF->GetSpacing()[2];
933 vfExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mVF->GetOrigin()[2]) /
934 mVF->GetSpacing()[2];
936 ClipDisplayedExtent(vfExtent,mVOIFilter->GetInput()->GetWholeExtent());
938 //----------------------------------------------------------------------------
941 //----------------------------------------------------------------------------
942 void vvSlicer::ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6])
944 vtkImageData* image=this->GetInput();
945 overExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mOverlay->GetOrigin()[0]) /
946 mOverlay->GetSpacing()[0];
947 overExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mOverlay->GetOrigin()[0]) /
948 mOverlay->GetSpacing()[0];
949 overExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mOverlay->GetOrigin()[1]) /
950 mOverlay->GetSpacing()[1];
951 overExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mOverlay->GetOrigin()[1]) /
952 mOverlay->GetSpacing()[1];
953 overExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mOverlay->GetOrigin()[2]) /
954 mOverlay->GetSpacing()[2];
955 overExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mOverlay->GetOrigin()[2]) /
956 mOverlay->GetSpacing()[2];
957 ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent());
959 //----------------------------------------------------------------------------
962 //----------------------------------------------------------------------------
963 void vvSlicer::ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int fusExtent[6])
965 vtkImageData* image=this->GetInput();
966 fusExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mFusion->GetOrigin()[0]) /
967 mFusion->GetSpacing()[0];
968 fusExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mFusion->GetOrigin()[0]) /
969 mFusion->GetSpacing()[0];
970 fusExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mFusion->GetOrigin()[1]) /
971 mFusion->GetSpacing()[1];
972 fusExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mFusion->GetOrigin()[1]) /
973 mFusion->GetSpacing()[1];
974 fusExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mFusion->GetOrigin()[2]) /
975 mFusion->GetSpacing()[2];
976 fusExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mFusion->GetOrigin()[2]) /
977 mFusion->GetSpacing()[2];
978 ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
980 //----------------------------------------------------------------------------
983 //----------------------------------------------------------------------------
984 void vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
989 //2D overlay on 3D image specific case
990 if (refExtent[4] == refExtent[5])
993 extent[4] = refExtent[4];
994 extent[5] = refExtent[5];
997 for (int i = 0; i < maxBound; i = i+2)
999 //if we are totally outside the image
1000 if ( extent[i] > refExtent[i+1] || extent[i+1] < refExtent[i] )
1005 //crop to the limit of the image
1006 extent[i] = (extent[i] > refExtent[i]) ? extent[i] : refExtent[i];
1007 extent[i] = (extent[i] < refExtent[i+1]) ? extent[i] : refExtent[i+1];
1008 extent[i+1] = (extent[i+1] > refExtent[i]) ? extent[i+1] : refExtent[i];
1009 extent[i+1] = (extent[i+1] < refExtent[i+1]) ? extent[i+1] : refExtent[i+1];
1012 for (int i = 0; i < maxBound; i = i+2)
1014 extent[i] = refExtent[i];
1015 extent[i+1] = refExtent[i];
1018 //----------------------------------------------------------------------------
1021 //----------------------------------------------------------------------------
1022 void vvSlicer::UpdateOrientation()
1024 // Set the camera position
1025 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1028 switch (this->SliceOrientation)
1030 case vtkImageViewer2::SLICE_ORIENTATION_XY:
1031 cam->SetFocalPoint(0,0,0);
1032 cam->SetPosition(0,0,-1); // -1 if medical ?
1033 cam->SetViewUp(0,-1,0);
1036 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
1037 cam->SetFocalPoint(0,0,0);
1038 cam->SetPosition(0,-1,0); // 1 if medical ?
1039 cam->SetViewUp(0,0,1);
1042 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
1043 cam->SetFocalPoint(0,0,0);
1044 cam->SetPosition(-1,0,0); // -1 if medical ?
1045 cam->SetViewUp(0,0,1);
1050 //----------------------------------------------------------------------------
1053 //----------------------------------------------------------------------------
1054 void vvSlicer::SetOpacity(double s)
1056 this->GetImageActor()->SetOpacity(s);
1058 //----------------------------------------------------------------------------
1061 //----------------------------------------------------------------------------
1062 void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
1064 this->Superclass::SetRenderWindow(rw);
1065 this->SetupInteractor(rw->GetInteractor());
1066 ca->SetImageActor(this->GetImageActor());
1067 ca->SetWindowLevel(this->GetWindowLevel());
1068 ca->SetText(2, "<slice>");
1069 ca->SetText(3, "<window>\n<level>");
1081 crossCursor->SetModelBounds(bounds);
1082 this->GetRenderer()->AddActor(pdmA);
1083 this->GetRenderer()->AddActor(ca);
1084 this->GetRenderer()->ResetCamera();
1086 //this is just a mapping between the labeling of the orientations presented to the user and
1087 //the one used by vtk
1088 SetSliceOrientation(2-(orientation%3));
1091 //----------------------------------------------------------------------------
1094 //----------------------------------------------------------------------------
1095 void vvSlicer::ResetCamera()
1097 if (this->GetInput())
1099 double* input_bounds=this->GetInput()->GetBounds();
1100 double bmax=input_bounds[1]-input_bounds[0];
1101 if (bmax < input_bounds[3]-input_bounds[2]) bmax=input_bounds[3]-input_bounds[2];
1102 if (bmax < input_bounds[5]-input_bounds[4]) bmax=input_bounds[5]-input_bounds[4];
1103 this->GetRenderer()->ResetCamera();
1104 this->GetRenderer()->GetActiveCamera()->SetParallelScale(bmax/2);
1107 //----------------------------------------------------------------------------
1110 //----------------------------------------------------------------------------
1111 void vvSlicer::SetDisplayMode(bool i)
1113 this->GetImageActor()->SetVisibility(i);
1114 this->GetAnnotation()->SetVisibility(i);
1115 this->GetRenderer()->SetDraw(i);
1117 mLandActor->SetVisibility(i);
1118 pdmA->SetVisibility(i);
1120 UpdateDisplayExtent();
1122 //----------------------------------------------------------------------------
1125 //----------------------------------------------------------------------------
1126 void vvSlicer::FlipHorizontalView()
1128 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1131 double *position = cam->GetPosition();
1132 switch (this->SliceOrientation)
1134 case vtkImageViewer2::SLICE_ORIENTATION_XY:
1135 cam->SetPosition(position[0],position[1],-position[2]);
1138 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
1139 cam->SetPosition(position[0],-position[1],position[2]);
1142 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
1143 cam->SetPosition(-position[0],position[1],position[2]);
1146 this->Renderer->ResetCameraClippingRange();
1147 this->UpdateDisplayExtent();
1150 //----------------------------------------------------------------------------
1153 //----------------------------------------------------------------------------
1154 void vvSlicer::FlipVerticalView()
1156 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1159 FlipHorizontalView();
1160 double *viewup = cam->GetViewUp();
1161 cam->SetViewUp(-viewup[0],-viewup[1],-viewup[2]);
1162 this->UpdateDisplayExtent();
1165 //----------------------------------------------------------------------------
1168 //----------------------------------------------------------------------------
1169 void vvSlicer::SetColorWindow(double window)
1171 vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
1174 double level = this->GetWindowLevel()->GetLevel();
1175 LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
1178 this->vtkImageViewer2::SetColorWindow(window);
1180 //----------------------------------------------------------------------------
1183 //----------------------------------------------------------------------------
1184 void vvSlicer::SetColorLevel(double level)
1186 vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
1189 double window = this->GetWindowLevel()->GetWindow();
1190 LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
1193 this->vtkImageViewer2::SetColorLevel(level);
1195 //----------------------------------------------------------------------------
1197 //----------------------------------------------------------------------------
1198 // Returns the min an the max value in a 41x41 region around the mouse pointer
1199 void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
1201 //Get mouse pointer position in view coordinates
1202 double fLocalExtents[6];
1203 for(int i=0; i<3; i++)
1205 fLocalExtents[i*2 ] = mCurrent[i];
1206 fLocalExtents[i*2+1] = mCurrent[i];
1208 this->Renderer->WorldToView(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
1209 this->Renderer->WorldToView(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
1210 for(int i=0; i<3; i++)
1212 if (i!=SliceOrientation) //SR: assumes that SliceOrientation is valid in ViewCoordinates (???)
1214 fLocalExtents[i*2 ] -= 0.2;
1215 fLocalExtents[i*2+1] += 0.2;
1218 this->Renderer->ViewToWorld(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
1219 this->Renderer->ViewToWorld(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
1221 //Convert to image pixel coordinates (rounded)
1222 int iLocalExtents[6];
1223 for(int i=0; i<3; i++)
1225 fLocalExtents[i*2 ] = (fLocalExtents[i*2 ] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
1226 fLocalExtents[i*2+1] = (fLocalExtents[i*2+1] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
1228 iLocalExtents[i*2 ] = lrint(fLocalExtents[i*2 ]);
1229 iLocalExtents[i*2+1] = lrint(fLocalExtents[i*2+1]);
1231 if(iLocalExtents[i*2 ]>iLocalExtents[i*2+1])
1232 std::swap(iLocalExtents[i*2], iLocalExtents[i*2+1]);
1235 vtkSmartPointer<vtkExtractVOI> voiFilter = vtkExtractVOI::New();
1236 voiFilter->SetInput(this->GetInput());
1237 voiFilter->SetVOI(iLocalExtents);
1238 voiFilter->Update();
1239 if (!voiFilter->GetOutput()->GetNumberOfPoints())
1246 vtkSmartPointer<vtkImageAccumulate> accFilter = vtkImageAccumulate::New();
1247 accFilter->SetInput(voiFilter->GetOutput());
1248 accFilter->Update();
1250 min = *(accFilter->GetMin());
1251 max = *(accFilter->GetMax());
1253 //----------------------------------------------------------------------------
1255 //----------------------------------------------------------------------------
1256 void vvSlicer::Render()
1258 // DD("vvSlicer::Render");
1259 // DD(SliceOrientation);
1260 if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion)
1262 legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable());
1263 legend->SetVisibility(1);
1265 else legend->SetVisibility(0);
1267 if (ca->GetVisibility())
1269 std::string worldPos = "";
1270 std::stringstream world1;
1271 std::stringstream world2;
1272 std::stringstream world3;
1273 world1 << (int)mCurrent[0];
1274 world2 << (int)mCurrent[1];
1275 world3 << (int)mCurrent[2];
1276 double X = (mCurrent[0] - this->GetInput()->GetOrigin()[0])/this->GetInput()->GetSpacing()[0];
1277 double Y = (mCurrent[1] - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
1278 double Z = (mCurrent[2] - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
1280 if (pdmA->GetVisibility())
1282 double x = mCursor[0];
1283 double y = mCursor[1];
1284 double z = mCursor[2];
1285 double xCursor = (x - this->GetInput()->GetOrigin()[0])/this->GetInput()->GetSpacing()[0];
1286 double yCursor = (y - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
1287 double zCursor = (z - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
1289 if (xCursor >= this->GetImageActor()->GetDisplayExtent()[0] &&
1290 xCursor < this->GetImageActor()->GetDisplayExtent()[1]+1 &&
1291 yCursor >= this->GetImageActor()->GetDisplayExtent()[2] &&
1292 yCursor < this->GetImageActor()->GetDisplayExtent()[3]+1 &&
1293 zCursor >= this->GetImageActor()->GetDisplayExtent()[4] &&
1294 zCursor < this->GetImageActor()->GetDisplayExtent()[5]+1 )
1296 vtkRenderer * renderer = this->Renderer;
1298 renderer->WorldToView(x,y,z);
1299 renderer->ViewToNormalizedViewport(x,y,z);
1300 renderer->NormalizedViewportToViewport(x,y);
1301 renderer->ViewportToNormalizedDisplay(x,y);
1302 renderer->NormalizedDisplayToDisplay(x,y);
1303 crossCursor->SetFocalPoint(x,y,z);
1306 crossCursor->SetFocalPoint(-1,-1,z);
1309 if (X >= this->GetInput()->GetWholeExtent()[0] &&
1310 X <= this->GetInput()->GetWholeExtent()[1] &&
1311 Y >= this->GetInput()->GetWholeExtent()[2] &&
1312 Y <= this->GetInput()->GetWholeExtent()[3] &&
1313 Z >= this->GetInput()->GetWholeExtent()[4] &&
1314 Z <= this->GetInput()->GetWholeExtent()[5])
1316 std::stringstream pixel1;
1317 std::stringstream pixel2;
1318 std::stringstream pixel3;
1319 std::stringstream temps;
1323 temps << mCurrentTSlice;
1324 double value = this->GetInput()->GetScalarComponentAsDouble(lrint(X),
1328 std::stringstream val;
1330 worldPos += "data value : " + val.str();
1331 worldPos += "\n mm : " + world1.str() + " " + world2.str() + " " +
1332 world3.str() + " " + temps.str();
1333 worldPos += "\n pixel : " + pixel1.str() + " " + pixel2.str() + " " +
1334 pixel3.str() + " " + temps.str();
1336 ca->SetText(1,worldPos.c_str());
1338 if (mOverlay && mOverlayActor->GetVisibility())
1340 mOverlayMapper->SetWindow(this->GetColorWindow());
1341 mOverlayMapper->SetLevel(this->GetColorLevel());
1342 mOverlayMapper->Update();
1346 //this->Superclass::Render();
1347 this->GetRenderWindow()->Render();
1349 //----------------------------------------------------------------------------
1352 //----------------------------------------------------------------------------
1353 void vvSlicer::UpdateCursorPosition()
1355 if (this->GetImageActor()->GetVisibility())
1357 pdmA->SetVisibility(true);
1358 mCursor[0] = mCurrent[0];
1359 mCursor[1] = mCurrent[1];
1360 mCursor[2] = mCurrent[2];
1361 mCursor[3] = mCurrentTSlice;
1364 //----------------------------------------------------------------------------
1367 //----------------------------------------------------------------------------
1368 void vvSlicer::UpdateLandmarks()
1370 vtkPolyData *pd = static_cast<vtkPolyData*>(mLandClipper->GetInput());
1371 if (pd->GetPoints())
1373 mLandGlyph->SetRange(0,1);
1374 mLandGlyph->Modified();
1375 mLandGlyph->Update();
1377 mClipBox->Modified();
1378 mLandClipper->Update();
1379 mLandMapper->Update();
1383 //----------------------------------------------------------------------------
1386 //----------------------------------------------------------------------------
1387 void vvSlicer::SetSlice(int slice)
1389 int *range = this->GetSliceRange();
1392 if (slice < range[0])
1396 else if (slice > range[1])
1402 if (this->Slice == slice)
1407 this->Slice = slice;
1410 this->UpdateDisplayExtent();
1412 // DD("SetSlice de slicer = Render");
1414 // Seems to work without this line
1417 //----------------------------------------------------------------------------
1420 //----------------------------------------------------------------------------
1421 void vvSlicer::SetContourSlice()
1423 if (mSurfaceCutActors.size() > 0)
1424 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
1425 i!=mSurfaceCutActors.end();i++)
1426 (*i)->SetCutSlice((this->Slice)*this->GetImage()->GetSpacing()[this->SliceOrientation]+
1427 this->GetImage()->GetOrigin()[this->SliceOrientation]);
1429 //----------------------------------------------------------------------------
1432 //----------------------------------------------------------------------------
1433 void vvSlicer::ForceUpdateDisplayExtent()
1435 this->UpdateDisplayExtent();
1437 //----------------------------------------------------------------------------
1440 //----------------------------------------------------------------------------
1441 int* vvSlicer::GetDisplayExtent()
1443 return this->GetImageActor()->GetDisplayExtent();
1445 //----------------------------------------------------------------------------
1448 //----------------------------------------------------------------------------
1449 void vvSlicer::PrintSelf(ostream& os, vtkIndent indent)
1451 this->Superclass::PrintSelf(os, indent);
1453 //----------------------------------------------------------------------------