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 <vvBlendImageActor.h>
38 #include <vtkToolkits.h>
39 #include <vtkObjectFactory.h>
40 #include <vtkPointData.h>
41 #include <vtkDataArray.h>
42 #include <vtkFloatArray.h>
43 #include <vtkClipPolyData.h>
44 #include <vtkGlyph3D.h>
46 #include <vtkCursor3D.h>
47 #include <vtkProperty.h>
49 #include <vtkLightCollection.h>
50 #include <vtkScalarBarActor.h>
51 #include <vtkLookupTable.h>
53 #include <vtkRenderer.h>
54 #include <vtkRendererCollection.h>
55 #include <vtkRenderWindow.h>
56 #include <vtkRenderWindowInteractor.h>
57 #include <vtkCamera.h>
58 #include <vtkCallbackCommand.h>
59 #include <vtkCommand.h>
60 #include <vtkPolyDataMapper.h>
63 #include <vtkExtractVOI.h>
64 #include <vtkSphereSource.h>
65 #include <vtkCutter.h>
66 #include <vtkAssignAttribute.h>
67 #include <vtkImageAccumulate.h>
68 #include <vtkImageReslice.h>
70 vtkCxxRevisionMacro(vvSlicer, "DummyRevision");
71 vtkStandardNewMacro(vvSlicer);
73 //------------------------------------------------------------------------------
78 mUseReducedExtent = false;
80 mCurrent[0] = -VTK_DOUBLE_MAX;
81 mCurrent[1] = -VTK_DOUBLE_MAX;
82 mCurrent[2] = -VTK_DOUBLE_MAX;
84 mCursor[0] = -VTK_DOUBLE_MAX;
85 mCursor[1] = -VTK_DOUBLE_MAX;
86 mCursor[2] = -VTK_DOUBLE_MAX;
87 mCursor[3] = -VTK_DOUBLE_MAX;
94 std::string text = "F1 = sagital; F2 = coronal; F3 = axial\n";
95 text += "F5 = horizontal flip; F6 = vertical flip\n\n";
96 text += "0,1,2,3,4,5 : preset windowing\n";
97 text += "6,7,8,9 : preset colormap\n";
98 text += "z : local windowing\n";
99 text += "r : reset view\n";
100 text += "l : reload image\n";
101 text += "f : fly to mouse position\n";
102 text += "g : go to cross hair position\n\n";
103 text += "Up,down : change slice\n";
104 text += "Left,right : change tenporal slice\n\n";
105 text += "Scrollbar (or w/x) : zoom in/out\n";
106 text += "left button : synchronize all views\n";
107 text += "middle button : grab image\n";
108 text += "right button : change windowing\n";
110 crossCursor = vtkCursor2D::New();
111 crossCursor->AllOff();
112 crossCursor->AxesOn();
113 crossCursor->SetTranslationMode(1);
114 crossCursor->SetRadius(2);
116 pdm = vtkPolyDataMapper2D::New();
117 pdm->SetInput(crossCursor->GetOutput());
119 pdmA = vtkActor2D::New();
120 pdmA->SetMapper(pdm);
121 pdmA->GetProperty()->SetColor(255,10,212);
122 pdmA->SetVisibility(0);
123 pdmA->SetPickable(0);
125 ca = vtkCornerAnnotation::New();
126 ca->GetTextProperty()->SetColor(255,10,212);
127 ca->SetVisibility(1);
135 legend = vtkSmartPointer<vtkScalarBarActor>::New();
136 //legend->SetTitle("test!");
137 legend->SetPosition(0.82,0.18);
138 legend->SetWidth(0.1);
139 legend->SetVisibility(0);
140 legend->SetLabelFormat("%.1f");
141 this->GetRenderer()->AddActor(legend);
143 this->WindowLevel->Delete();
144 this->WindowLevel = vvImageMapToWLColors::New();
145 this->InstallPipeline();
148 //------------------------------------------------------------------------------
151 //------------------------------------------------------------------------------
152 vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper() {
153 return mOverlayMapper.GetPointer();
155 //------------------------------------------------------------------------------
158 //------------------------------------------------------------------------------
159 vvBlendImageActor* vvSlicer::GetOverlayActor() {
160 return mOverlayActor.GetPointer();
162 //------------------------------------------------------------------------------
165 //------------------------------------------------------------------------------
166 vtkImageMapToWindowLevelColors* vvSlicer::GetFusionMapper() {
167 return mFusionMapper.GetPointer();
169 //------------------------------------------------------------------------------
172 //------------------------------------------------------------------------------
173 vtkImageActor* vvSlicer::GetFusionActor() {
174 return mFusionActor.GetPointer();
176 //------------------------------------------------------------------------------
179 //------------------------------------------------------------------------------
180 vtkActor* vvSlicer::GetVFActor() {
181 return mVFActor.GetPointer();
183 //------------------------------------------------------------------------------
186 //------------------------------------------------------------------------------
187 vtkCornerAnnotation* vvSlicer::GetAnnotation() {
188 return ca.GetPointer();
190 //------------------------------------------------------------------------------
193 //------------------------------------------------------------------------------
194 void vvSlicer::EnableReducedExtent(bool b) {
195 mUseReducedExtent = b;
197 //------------------------------------------------------------------------------
200 //------------------------------------------------------------------------------
201 void vvSlicer::SetReducedExtent(int * ext) {
202 mReducedExtent = ext;
204 //------------------------------------------------------------------------------
207 //------------------------------------------------------------------------------
208 void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate)
211 mSurfaceCutActors.push_back(new vvMeshActor());
213 mSurfaceCutActors.back()->Init(contour,mCurrentTSlice,mVF);
215 mSurfaceCutActors.back()->Init(contour,mCurrentTSlice);
216 mSurfaceCutActors.back()->SetSlicingOrientation(SliceOrientation);
217 this->GetRenderer()->AddActor(mSurfaceCutActors.back()->GetActor());
221 //------------------------------------------------------------------------------
224 //------------------------------------------------------------------------------
225 void vvSlicer::ToggleContourSuperposition()
227 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
228 i!=mSurfaceCutActors.end();i++)
229 (*i)->ToggleSuperposition();
231 //------------------------------------------------------------------------------
234 //------------------------------------------------------------------------------
235 void vvSlicer::SetCursorColor(int r,int g, int b)
237 pdmA->GetProperty()->SetColor(r,g,b);
239 //------------------------------------------------------------------------------
242 //------------------------------------------------------------------------------
243 void vvSlicer::SetCursorVisibility(bool s)
245 pdmA->SetVisibility(s);
247 //------------------------------------------------------------------------------
250 //------------------------------------------------------------------------------
251 bool vvSlicer::GetCursorVisibility()
253 return pdmA->GetVisibility();
255 //------------------------------------------------------------------------------
258 //------------------------------------------------------------------------------
259 vvSlicer::~vvSlicer()
261 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
262 i!=mSurfaceCutActors.end();i++)
265 //------------------------------------------------------------------------------
268 //------------------------------------------------------------------------------
269 void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
276 //------------------------------------------------------------------------------
279 //------------------------------------------------------------------------------
280 void vvSlicer::SetImage(vvImage::Pointer image)
282 if (image->GetVTKImages().size())
285 this->Superclass::SetInput(image->GetVTKImages()[0]);
287 // Prevent crash when reload -> change slice if outside extent
289 this->GetInput()->GetWholeExtent(extent);
290 if (SliceOrientation == 0) {
291 if (Slice >= extent[1]) {
292 Slice = (extent[1]-extent[0])/2.0;
295 if (SliceOrientation == 1) {
296 if (Slice >= extent[3]) {
297 Slice = (extent[3]-extent[2])/2.0;
300 if (SliceOrientation == 2) {
301 if (Slice >= extent[5]) {
302 Slice = (extent[5]-extent[4])/2.0;
306 this->UpdateDisplayExtent();
308 ca->SetText(0,mFileName.c_str());
311 //------------------------------------------------------------------------------
314 //------------------------------------------------------------------------------
315 void vvSlicer::SetOverlay(vvImage::Pointer overlay)
317 if (overlay->GetVTKImages().size())
322 mOverlayMapper = vtkImageMapToWindowLevelColors::New();
323 mOverlayMapper->SetInput(overlay->GetVTKImages()[0]);
327 mOverlayActor = vvBlendImageActor::New();
328 mOverlayActor->SetInput(mOverlayMapper->GetOutput());
329 mOverlayActor->SetPickable(0);
330 mOverlayActor->SetVisibility(false);
331 mOverlayActor->SetOpacity(0.5);
332 this->UpdateDisplayExtent();
335 //stupid but necessary : the Overlay need to be rendered before fusion
338 this->GetRenderer()->RemoveActor(mFusionActor);
339 this->GetRenderer()->AddActor(mOverlayActor);
340 this->GetRenderer()->AddActor(mFusionActor);
343 this->GetRenderer()->AddActor(mOverlayActor);
346 SetTSlice(mCurrentTSlice);
349 //------------------------------------------------------------------------------
352 //------------------------------------------------------------------------------
353 void vvSlicer::SetFusion(vvImage::Pointer fusion)
355 if (fusion->GetVTKImages().size())
360 mFusionMapper = vtkImageMapToWindowLevelColors::New();
361 mFusionMapper->SetInput(fusion->GetVTKImages()[0]);
365 mFusionActor = vtkImageActor::New();
366 mFusionActor->SetInput(mFusionMapper->GetOutput());
367 mFusionActor->SetPickable(0);
368 mFusionActor->SetVisibility(false);
369 mFusionActor->SetOpacity(0.7);
370 this->UpdateDisplayExtent();
371 this->GetRenderer()->AddActor(mFusionActor);
375 SetTSlice(mCurrentTSlice);
378 //------------------------------------------------------------------------------
381 //------------------------------------------------------------------------------
382 void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis)
384 if (actor_type == "vector")
386 this->mVFActor->SetVisibility(vis);
388 if (actor_type == "overlay")
390 this->mOverlayActor->SetVisibility(vis);
392 if (actor_type == "fusion")
394 this->mFusionActor->SetVisibility(vis);
396 if (actor_type == "contour")
397 this->mSurfaceCutActors[overlay_index]->GetActor()->SetVisibility(vis);
398 UpdateDisplayExtent();
400 //------------------------------------------------------------------------------
403 //------------------------------------------------------------------------------
404 void vvSlicer::SetVF(vvImage::Pointer vf)
406 if (vf->GetVTKImages().size())
412 mAAFilter=vtkAssignAttribute::New();
413 mVOIFilter = vtkExtractVOI::New();
414 mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
416 mVOIFilter->SetInput(vf->GetVTKImages()[0]);
417 mAAFilter->SetInput(mVOIFilter->GetOutput());
418 ///This tells VTK to use the scalar (pixel) data of the image to draw the little arrows
419 mAAFilter->Assign(vtkDataSetAttributes::SCALARS, vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA);
422 mArrow = vvGlyphSource::New();
423 mArrow->SetGlyphTypeToSpecificArrow();
424 mArrow->SetScale(mScale);
427 // Glyph the gradient vector (with arrows)
429 mGlyphFilter = vvGlyph2D::New();
430 mGlyphFilter->SetInput(mAAFilter->GetOutput());
431 mGlyphFilter->SetSource(mArrow->GetOutput());
432 mGlyphFilter->ScalingOn();
433 mGlyphFilter->SetScaleModeToScaleByVector();
434 mGlyphFilter->OrientOn();
435 mGlyphFilter->SetVectorModeToUseVector();
436 mGlyphFilter->SetColorModeToColorByVector();
439 mVFMapper = vtkPolyDataMapper::New();
440 //mVFMapper->SetInputConnection(mGlyphFilter->GetOutputPort());
441 mVFMapper->SetInput(mGlyphFilter->GetOutput());
442 mVFMapper->ImmediateModeRenderingOn();
445 mVFActor = vtkActor::New();
446 mVFActor->SetMapper(mVFMapper);
447 mVFActor->SetPickable(0);
448 mVFActor->GetProperty()->SetLineWidth(mVFWidth);
449 this->UpdateDisplayExtent();
450 this->GetRenderer()->AddActor(mVFActor);
453 SetTSlice(mCurrentTSlice);
456 //------------------------------------------------------------------------------
459 //------------------------------------------------------------------------------
460 void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
462 mLandmarks = landmarks;
467 mCross = vtkCursor3D::New();
468 mCross->SetFocalPoint(0.0,0.0,0.0);
469 mCross->SetModelBounds(-10,10,-10,10,-10,10);
474 mLandGlyph = vtkGlyph3D::New();
475 mLandGlyph->SetSource(mCross->GetOutput());
476 mLandGlyph->SetInput(landmarks->GetOutput());
477 //mLandGlyph->SetIndexModeToScalar();
478 mLandGlyph->SetRange(0,1);
479 mLandGlyph->ScalingOff();
481 mLandGlyph->SetColorModeToColorByScalar();
484 mClipBox = vtkBox::New();
486 mLandClipper = vtkClipPolyData::New();
487 mLandClipper->InsideOutOn();
488 mLandClipper->SetInput(mLandGlyph->GetOutput());
489 mLandClipper->SetClipFunction(mClipBox);
492 mLandMapper = vtkPolyDataMapper::New();
493 mLandMapper->SetInputConnection(mLandClipper->GetOutputPort());
494 //mLandMapper->ScalarVisibilityOff();
497 mLandActor = vtkActor::New();
498 mLandActor->SetMapper(mLandMapper);
499 mLandActor->GetProperty()->SetColor(255,10,212);
500 mLandActor->SetPickable(0);
501 mLandActor->SetVisibility(true);
502 this->UpdateDisplayExtent();
503 this->GetRenderer()->AddActor(mLandActor);
506 //------------------------------------------------------------------------------
508 //------------------------------------------------------------------------------
509 //FIXME: this function leaks memory, we should fix it someday :)
510 void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
512 if (actor_type == "vector")
514 Renderer->RemoveActor(mVFActor);
523 if (actor_type == "overlay")
525 Renderer->RemoveActor(mOverlayActor);
527 mOverlayActor = NULL;
528 mOverlayMapper = NULL;
530 if (actor_type == "fusion")
532 Renderer->RemoveActor(mFusionActor);
535 mFusionMapper = NULL;
537 if (actor_type == "contour")
539 Renderer->RemoveActor(this->mSurfaceCutActors[overlay_index]->GetActor());
540 mSurfaceCutActors.erase(mSurfaceCutActors.begin()+overlay_index);
543 //------------------------------------------------------------------------------
546 //------------------------------------------------------------------------------
547 void vvSlicer::SetVFSubSampling(int sub)
551 mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
554 UpdateDisplayExtent();
557 //------------------------------------------------------------------------------
560 //------------------------------------------------------------------------------
561 void vvSlicer::SetVFScale(int scale)
565 mArrow->SetScale(mScale);
566 UpdateDisplayExtent();
569 //------------------------------------------------------------------------------
571 //------------------------------------------------------------------------------
572 void vvSlicer::SetVFWidth(int width)
576 mVFActor->GetProperty()->SetLineWidth(mVFWidth);
577 UpdateDisplayExtent();
580 //------------------------------------------------------------------------------
583 //------------------------------------------------------------------------------
584 void vvSlicer::SetVFLog(int log)
589 mGlyphFilter->SetUseLog(mVFLog);
590 mGlyphFilter->Modified();
592 UpdateDisplayExtent();
595 //------------------------------------------------------------------------------
598 //------------------------------------------------------------------------------
599 void vvSlicer::SetTSlice(int t)
603 else if ((unsigned int)t >= mImage->GetVTKImages().size())
604 t = mImage->GetVTKImages().size() -1;
606 if (mCurrentTSlice == t) return;
609 this->SetInput(mImage->GetVTKImages()[t]);
610 if (mVF && mVFActor->GetVisibility())
612 if (mVF->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
613 mVOIFilter->SetInput(mVF->GetVTKImages()[mCurrentTSlice]);
615 if (mOverlay && mOverlayActor->GetVisibility())
617 if (mOverlay->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
618 mOverlayMapper->SetInput(mOverlay->GetVTKImages()[mCurrentTSlice]);
620 if (mFusion && mFusionActor->GetVisibility())
622 if (mFusion->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
623 mFusionMapper->SetInput(mFusion->GetVTKImages()[mCurrentTSlice]);
625 if (mSurfaceCutActors.size() > 0)
626 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
627 i!=mSurfaceCutActors.end();i++)
628 (*i)->SetTimeSlice(mCurrentTSlice);
629 UpdateDisplayExtent();
631 //------------------------------------------------------------------------------
634 //------------------------------------------------------------------------------
635 int vvSlicer::GetTSlice()
637 return mCurrentTSlice;
639 //------------------------------------------------------------------------------
642 //------------------------------------------------------------------------------
643 void vvSlicer::SetSliceOrientation(int orientation)
645 //if 2D image, force to watch in Axial View
647 this->GetInput()->GetWholeExtent(extent);
648 if (extent[5]-extent[4] <= 2)
651 if (orientation < vtkImageViewer2::SLICE_ORIENTATION_YZ ||
652 orientation > vtkImageViewer2::SLICE_ORIENTATION_XY)
654 vtkErrorMacro("Error - invalid slice orientation " << orientation);
658 this->SliceOrientation = orientation;
661 int *range = this->GetSliceRange();
663 this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
665 this->UpdateOrientation();
666 this->UpdateDisplayExtent();
668 if (this->Renderer && this->GetInput())
670 double scale = this->Renderer->GetActiveCamera()->GetParallelScale();
671 this->Renderer->ResetCamera();
672 this->Renderer->GetActiveCamera()->SetParallelScale(scale);
677 //----------------------------------------------------------------------------
680 //----------------------------------------------------------------------------
681 int * vvSlicer::GetExtent() {
683 if (mUseReducedExtent) {
684 w_ext = mReducedExtent;
686 else w_ext = GetInput()->GetWholeExtent();
689 //----------------------------------------------------------------------------
692 //----------------------------------------------------------------------------
693 int vvSlicer::GetOrientation() {
694 return this->SliceOrientation;
696 //----------------------------------------------------------------------------
699 //----------------------------------------------------------------------------
700 void vvSlicer::UpdateDisplayExtent()
702 vtkImageData *input = this->GetInput();
703 if (!input || !this->ImageActor)
707 input->UpdateInformation();
708 int *w_ext;// = input->GetWholeExtent();
710 if (mUseReducedExtent) {
711 w_ext = mReducedExtent;
713 else w_ext = input->GetWholeExtent();
715 switch (this->SliceOrientation)
717 case vtkImageViewer2::SLICE_ORIENTATION_XY:
718 this->ImageActor->SetDisplayExtent(
719 w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice);
720 if (mVF && mVFActor->GetVisibility())
723 ComputeVFDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,vfExtent);
724 mVOIFilter->SetVOI(vfExtent);
725 mGlyphFilter->SetOrientation(1,1,0);
727 // put the vector field between the image and the camera
728 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
729 mVFActor->SetPosition(0,0,ImageActor->GetBounds()[5]+2);
731 mVFActor->SetPosition(0,0,ImageActor->GetBounds()[4]-2);
733 if (mOverlay && mOverlayActor->GetVisibility())
736 ComputeOverlayDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,overExtent);
737 mOverlayActor->SetDisplayExtent(overExtent);
738 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
739 mOverlayActor->SetPosition(0,0,1);
741 mOverlayActor->SetPosition(0,0,-1);
743 if (mFusion && mFusionActor->GetVisibility())
746 ComputeFusionDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,fusExtent);
747 mFusionActor->SetDisplayExtent(fusExtent);
748 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
749 mFusionActor->SetPosition(0,0,1.5);
751 mFusionActor->SetPosition(0,0,-1.5);
758 bounds[0] = ImageActor->GetBounds()[0];
759 bounds[1] = ImageActor->GetBounds()[1];
760 bounds[2] = ImageActor->GetBounds()[2];
761 bounds[3] = ImageActor->GetBounds()[3];
762 bounds[4] = ImageActor->GetBounds()[4]-(0.9/this->GetInput()->GetSpacing()[2]);
763 bounds[5] = ImageActor->GetBounds()[5]+(0.9/this->GetInput()->GetSpacing()[2]);
764 mClipBox->SetBounds(bounds);
767 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
768 mLandActor->SetPosition(0,0,1.5);
770 mLandActor->SetPosition(0,0,-1.5);
774 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
775 this->ImageActor->SetDisplayExtent(
776 w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5]);
777 if (mVF && mVFActor->GetVisibility())
780 ComputeVFDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],vfExtent);
781 mVOIFilter->SetVOI(vfExtent);
782 mGlyphFilter->SetOrientation(1,0,1);
784 // put the vector field between the image aSpacingnd the camera
785 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
786 mVFActor->SetPosition(0,ImageActor->GetBounds()[3]+2,0);
788 mVFActor->SetPosition(0,ImageActor->GetBounds()[2]-2,0);
790 if (mOverlay && mOverlayActor->GetVisibility())
793 ComputeOverlayDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],overExtent);
794 mOverlayActor->SetDisplayExtent(overExtent);
795 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
796 mOverlayActor->SetPosition(0,1,0);
798 mOverlayActor->SetPosition(0,-1,0);
800 if (mFusion && mFusionActor->GetVisibility())
803 ComputeFusionDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],fusExtent);
804 mFusionActor->SetDisplayExtent(fusExtent);
805 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
806 mFusionActor->SetPosition(0,1.5,0);
808 mFusionActor->SetPosition(0,-1.5,0);
815 bounds[0] = ImageActor->GetBounds()[0];
816 bounds[1] = ImageActor->GetBounds()[1];
817 bounds[2] = ImageActor->GetBounds()[2]-(0.5/this->GetInput()->GetSpacing()[1]);
818 bounds[3] = ImageActor->GetBounds()[3]+(0.5/this->GetInput()->GetSpacing()[1]);
819 bounds[4] = ImageActor->GetBounds()[4];
820 bounds[5] = ImageActor->GetBounds()[5];
821 mClipBox->SetBounds(bounds);
824 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
825 mLandActor->SetPosition(0,1.5,0);
827 mLandActor->SetPosition(0,-1.5,0);
831 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
832 this->ImageActor->SetDisplayExtent(
833 this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
834 if (mVF && mVFActor->GetVisibility())
837 ComputeVFDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],vfExtent);
838 mVOIFilter->SetVOI(vfExtent);
839 mGlyphFilter->SetOrientation(0,1,1);
841 // put the vector field between the image and the camera
842 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
843 mVFActor->SetPosition(ImageActor->GetBounds()[1]+2,0,0);
845 mVFActor->SetPosition(ImageActor->GetBounds()[0]-2,0,0);
847 if (mOverlay && mOverlayActor->GetVisibility())
850 ComputeOverlayDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],overExtent);
851 mOverlayActor->SetDisplayExtent(overExtent);
852 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
853 mOverlayActor->SetPosition(1,0,0);
855 mOverlayActor->SetPosition(-1,0,0);
857 if (mFusion && mFusionActor->GetVisibility())
860 ComputeFusionDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],fusExtent);
861 mFusionActor->SetDisplayExtent(fusExtent);
862 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
863 mFusionActor->SetPosition(1.5,0,0);
865 mFusionActor->SetPosition(-1.5,0,0);
872 bounds[0] = ImageActor->GetBounds()[0]-(0.5/this->GetInput()->GetSpacing()[0]);
873 bounds[1] = ImageActor->GetBounds()[1]+(0.5/this->GetInput()->GetSpacing()[0]);
874 bounds[2] = ImageActor->GetBounds()[2];
875 bounds[3] = ImageActor->GetBounds()[3];
876 bounds[4] = ImageActor->GetBounds()[4];
877 bounds[5] = ImageActor->GetBounds()[5];
878 mClipBox->SetBounds(bounds);
881 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
882 mLandActor->SetPosition(1.5,0,0);
884 mLandActor->SetPosition(-1.5,0,0);
889 // Figure out the correct clipping range
893 if (this->InteractorStyle &&
894 this->InteractorStyle->GetAutoAdjustCameraClippingRange())
896 this->Renderer->ResetCameraClippingRange();
900 vtkCamera *cam = this->Renderer->GetActiveCamera();
904 this->ImageActor->GetBounds(bounds);
905 double spos = (double)bounds[this->SliceOrientation * 2];
906 double cpos = (double)cam->GetPosition()[this->SliceOrientation];
907 double range = fabs(spos - cpos);
908 double *spacing = input->GetSpacing();
910 ((double)spacing[0] + (double)spacing[1] + (double)spacing[2]) / 3.0;
911 cam->SetClippingRange(
912 range - avg_spacing * 3.0, range + avg_spacing * 3.0);
917 //----------------------------------------------------------------------------
920 //----------------------------------------------------------------------------
921 void vvSlicer::ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int vfExtent[6])
923 vtkImageData* image=this->GetInput();
924 vfExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mVF->GetOrigin()[0]) /
925 mVF->GetSpacing()[0];
926 vfExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mVF->GetOrigin()[0]) /
927 mVF->GetSpacing()[0];
928 vfExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mVF->GetOrigin()[1]) /
929 mVF->GetSpacing()[1];
930 vfExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mVF->GetOrigin()[1]) /
931 mVF->GetSpacing()[1];
932 vfExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mVF->GetOrigin()[2]) /
933 mVF->GetSpacing()[2];
934 vfExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mVF->GetOrigin()[2]) /
935 mVF->GetSpacing()[2];
937 ClipDisplayedExtent(vfExtent,mVOIFilter->GetInput()->GetWholeExtent());
939 //----------------------------------------------------------------------------
942 //----------------------------------------------------------------------------
943 void vvSlicer::ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6])
945 vtkImageData* image=this->GetInput();
946 overExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mOverlay->GetOrigin()[0]) /
947 mOverlay->GetSpacing()[0];
948 overExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mOverlay->GetOrigin()[0]) /
949 mOverlay->GetSpacing()[0];
950 overExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mOverlay->GetOrigin()[1]) /
951 mOverlay->GetSpacing()[1];
952 overExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mOverlay->GetOrigin()[1]) /
953 mOverlay->GetSpacing()[1];
954 overExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mOverlay->GetOrigin()[2]) /
955 mOverlay->GetSpacing()[2];
956 overExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mOverlay->GetOrigin()[2]) /
957 mOverlay->GetSpacing()[2];
958 ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent());
960 //----------------------------------------------------------------------------
963 //----------------------------------------------------------------------------
964 void vvSlicer::ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int fusExtent[6])
966 vtkImageData* image=this->GetInput();
967 fusExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mFusion->GetOrigin()[0]) /
968 mFusion->GetSpacing()[0];
969 fusExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mFusion->GetOrigin()[0]) /
970 mFusion->GetSpacing()[0];
971 fusExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mFusion->GetOrigin()[1]) /
972 mFusion->GetSpacing()[1];
973 fusExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mFusion->GetOrigin()[1]) /
974 mFusion->GetSpacing()[1];
975 fusExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mFusion->GetOrigin()[2]) /
976 mFusion->GetSpacing()[2];
977 fusExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mFusion->GetOrigin()[2]) /
978 mFusion->GetSpacing()[2];
979 ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
981 //----------------------------------------------------------------------------
984 //----------------------------------------------------------------------------
985 void vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
990 //2D overlay on 3D image specific case
991 if (refExtent[4] == refExtent[5])
994 extent[4] = refExtent[4];
995 extent[5] = refExtent[5];
998 for (int i = 0; i < maxBound; i = i+2)
1000 //if we are totally outside the image
1001 if ( extent[i] > refExtent[i+1] || extent[i+1] < refExtent[i] )
1006 //crop to the limit of the image
1007 extent[i] = (extent[i] > refExtent[i]) ? extent[i] : refExtent[i];
1008 extent[i] = (extent[i] < refExtent[i+1]) ? extent[i] : refExtent[i+1];
1009 extent[i+1] = (extent[i+1] > refExtent[i]) ? extent[i+1] : refExtent[i];
1010 extent[i+1] = (extent[i+1] < refExtent[i+1]) ? extent[i+1] : refExtent[i+1];
1013 for (int i = 0; i < maxBound; i = i+2)
1015 extent[i] = refExtent[i];
1016 extent[i+1] = refExtent[i];
1019 //----------------------------------------------------------------------------
1022 //----------------------------------------------------------------------------
1023 void vvSlicer::UpdateOrientation()
1025 // Set the camera position
1026 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1029 switch (this->SliceOrientation)
1031 case vtkImageViewer2::SLICE_ORIENTATION_XY:
1032 cam->SetFocalPoint(0,0,0);
1033 cam->SetPosition(0,0,-1); // -1 if medical ?
1034 cam->SetViewUp(0,-1,0);
1037 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
1038 cam->SetFocalPoint(0,0,0);
1039 cam->SetPosition(0,-1,0); // 1 if medical ?
1040 cam->SetViewUp(0,0,1);
1043 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
1044 cam->SetFocalPoint(0,0,0);
1045 cam->SetPosition(-1,0,0); // -1 if medical ?
1046 cam->SetViewUp(0,0,1);
1051 //----------------------------------------------------------------------------
1054 //----------------------------------------------------------------------------
1055 void vvSlicer::SetOpacity(double s)
1057 this->GetImageActor()->SetOpacity(s);
1059 //----------------------------------------------------------------------------
1062 //----------------------------------------------------------------------------
1063 void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
1065 this->Superclass::SetRenderWindow(rw);
1066 this->SetupInteractor(rw->GetInteractor());
1067 ca->SetImageActor(this->GetImageActor());
1068 ca->SetWindowLevel(this->GetWindowLevel());
1069 ca->SetText(2, "<slice>");
1070 ca->SetText(3, "<window>\n<level>");
1082 crossCursor->SetModelBounds(bounds);
1083 this->GetRenderer()->AddActor(pdmA);
1084 this->GetRenderer()->AddActor(ca);
1085 this->GetRenderer()->ResetCamera();
1087 //this is just a mapping between the labeling of the orientations presented to the user and
1088 //the one used by vtk
1089 SetSliceOrientation(2-(orientation%3));
1092 //----------------------------------------------------------------------------
1095 //----------------------------------------------------------------------------
1096 void vvSlicer::ResetCamera()
1098 if (this->GetInput())
1100 double* input_bounds=this->GetInput()->GetBounds();
1101 double bmax=input_bounds[1]-input_bounds[0];
1102 if (bmax < input_bounds[3]-input_bounds[2]) bmax=input_bounds[3]-input_bounds[2];
1103 if (bmax < input_bounds[5]-input_bounds[4]) bmax=input_bounds[5]-input_bounds[4];
1104 this->GetRenderer()->ResetCamera();
1105 this->GetRenderer()->GetActiveCamera()->SetParallelScale(bmax/2);
1108 //----------------------------------------------------------------------------
1111 //----------------------------------------------------------------------------
1112 void vvSlicer::SetDisplayMode(bool i)
1114 this->GetImageActor()->SetVisibility(i);
1115 this->GetAnnotation()->SetVisibility(i);
1116 this->GetRenderer()->SetDraw(i);
1118 mLandActor->SetVisibility(i);
1119 pdmA->SetVisibility(i);
1121 UpdateDisplayExtent();
1123 //----------------------------------------------------------------------------
1126 //----------------------------------------------------------------------------
1127 void vvSlicer::FlipHorizontalView()
1129 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1132 double *position = cam->GetPosition();
1133 switch (this->SliceOrientation)
1135 case vtkImageViewer2::SLICE_ORIENTATION_XY:
1136 cam->SetPosition(position[0],position[1],-position[2]);
1139 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
1140 cam->SetPosition(position[0],-position[1],position[2]);
1143 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
1144 cam->SetPosition(-position[0],position[1],position[2]);
1147 this->Renderer->ResetCameraClippingRange();
1148 this->UpdateDisplayExtent();
1151 //----------------------------------------------------------------------------
1154 //----------------------------------------------------------------------------
1155 void vvSlicer::FlipVerticalView()
1157 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1160 FlipHorizontalView();
1161 double *viewup = cam->GetViewUp();
1162 cam->SetViewUp(-viewup[0],-viewup[1],-viewup[2]);
1163 this->UpdateDisplayExtent();
1166 //----------------------------------------------------------------------------
1169 //----------------------------------------------------------------------------
1170 void vvSlicer::SetColorWindow(double window)
1172 vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
1175 double level = this->GetWindowLevel()->GetLevel();
1176 LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
1179 this->vtkImageViewer2::SetColorWindow(window);
1181 //----------------------------------------------------------------------------
1184 //----------------------------------------------------------------------------
1185 void vvSlicer::SetColorLevel(double level)
1187 vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
1190 double window = this->GetWindowLevel()->GetWindow();
1191 LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
1194 this->vtkImageViewer2::SetColorLevel(level);
1196 //----------------------------------------------------------------------------
1198 //----------------------------------------------------------------------------
1199 // Returns the min an the max value in a 41x41 region around the mouse pointer
1200 void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
1202 //Get mouse pointer position in view coordinates
1203 double fLocalExtents[6];
1204 for(int i=0; i<3; i++)
1206 fLocalExtents[i*2 ] = mCurrent[i];
1207 fLocalExtents[i*2+1] = mCurrent[i];
1209 this->Renderer->WorldToView(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
1210 this->Renderer->WorldToView(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
1211 for(int i=0; i<3; i++)
1213 if (i!=SliceOrientation) //SR: assumes that SliceOrientation is valid in ViewCoordinates (???)
1215 fLocalExtents[i*2 ] -= 0.2;
1216 fLocalExtents[i*2+1] += 0.2;
1219 this->Renderer->ViewToWorld(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
1220 this->Renderer->ViewToWorld(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
1222 //Convert to image pixel coordinates (rounded)
1223 int iLocalExtents[6];
1224 for(int i=0; i<3; i++)
1226 fLocalExtents[i*2 ] = (fLocalExtents[i*2 ] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
1227 fLocalExtents[i*2+1] = (fLocalExtents[i*2+1] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
1229 iLocalExtents[i*2 ] = lrint(fLocalExtents[i*2 ]);
1230 iLocalExtents[i*2+1] = lrint(fLocalExtents[i*2+1]);
1232 if(iLocalExtents[i*2 ]>iLocalExtents[i*2+1])
1233 std::swap(iLocalExtents[i*2], iLocalExtents[i*2+1]);
1236 vtkSmartPointer<vtkExtractVOI> voiFilter = vtkExtractVOI::New();
1237 voiFilter->SetInput(this->GetInput());
1238 voiFilter->SetVOI(iLocalExtents);
1239 voiFilter->Update();
1240 if (!voiFilter->GetOutput()->GetNumberOfPoints())
1247 vtkSmartPointer<vtkImageAccumulate> accFilter = vtkImageAccumulate::New();
1248 accFilter->SetInput(voiFilter->GetOutput());
1249 accFilter->Update();
1251 min = *(accFilter->GetMin());
1252 max = *(accFilter->GetMax());
1254 //----------------------------------------------------------------------------
1256 //----------------------------------------------------------------------------
1257 void vvSlicer::Render()
1259 // DD("vvSlicer::Render");
1260 // DD(SliceOrientation);
1261 if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion)
1263 legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable());
1264 legend->SetVisibility(1);
1266 else legend->SetVisibility(0);
1268 if (ca->GetVisibility())
1270 std::string worldPos = "";
1271 std::stringstream world1;
1272 std::stringstream world2;
1273 std::stringstream world3;
1274 world1 << (int)mCurrent[0];
1275 world2 << (int)mCurrent[1];
1276 world3 << (int)mCurrent[2];
1277 double X = (mCurrent[0] - this->GetInput()->GetOrigin()[0])/this->GetInput()->GetSpacing()[0];
1278 double Y = (mCurrent[1] - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
1279 double Z = (mCurrent[2] - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
1281 if (pdmA->GetVisibility())
1283 double x = mCursor[0];
1284 double y = mCursor[1];
1285 double z = mCursor[2];
1286 double xCursor = (x - this->GetInput()->GetOrigin()[0])/this->GetInput()->GetSpacing()[0];
1287 double yCursor = (y - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
1288 double zCursor = (z - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
1290 if (xCursor >= this->GetImageActor()->GetDisplayExtent()[0] &&
1291 xCursor < this->GetImageActor()->GetDisplayExtent()[1]+1 &&
1292 yCursor >= this->GetImageActor()->GetDisplayExtent()[2] &&
1293 yCursor < this->GetImageActor()->GetDisplayExtent()[3]+1 &&
1294 zCursor >= this->GetImageActor()->GetDisplayExtent()[4] &&
1295 zCursor < this->GetImageActor()->GetDisplayExtent()[5]+1 )
1297 vtkRenderer * renderer = this->Renderer;
1299 renderer->WorldToView(x,y,z);
1300 renderer->ViewToNormalizedViewport(x,y,z);
1301 renderer->NormalizedViewportToViewport(x,y);
1302 renderer->ViewportToNormalizedDisplay(x,y);
1303 renderer->NormalizedDisplayToDisplay(x,y);
1304 crossCursor->SetFocalPoint(x,y,z);
1307 crossCursor->SetFocalPoint(-1,-1,z);
1310 if (X >= this->GetInput()->GetWholeExtent()[0] &&
1311 X <= this->GetInput()->GetWholeExtent()[1] &&
1312 Y >= this->GetInput()->GetWholeExtent()[2] &&
1313 Y <= this->GetInput()->GetWholeExtent()[3] &&
1314 Z >= this->GetInput()->GetWholeExtent()[4] &&
1315 Z <= this->GetInput()->GetWholeExtent()[5])
1317 std::stringstream pixel1;
1318 std::stringstream pixel2;
1319 std::stringstream pixel3;
1320 std::stringstream temps;
1324 temps << mCurrentTSlice;
1325 double value = this->GetInput()->GetScalarComponentAsDouble(lrint(X),
1329 std::stringstream val;
1331 worldPos += "data value : " + val.str();
1332 worldPos += "\n mm : " + world1.str() + " " + world2.str() + " " +
1333 world3.str() + " " + temps.str();
1334 worldPos += "\n pixel : " + pixel1.str() + " " + pixel2.str() + " " +
1335 pixel3.str() + " " + temps.str();
1337 ca->SetText(1,worldPos.c_str());
1339 if (mOverlay && mOverlayActor->GetVisibility())
1341 mOverlayMapper->SetWindow(this->GetColorWindow());
1342 mOverlayMapper->SetLevel(this->GetColorLevel());
1343 mOverlayMapper->Update();
1347 //this->Superclass::Render();
1348 this->GetRenderWindow()->Render();
1350 //----------------------------------------------------------------------------
1353 //----------------------------------------------------------------------------
1354 void vvSlicer::UpdateCursorPosition()
1356 if (this->GetImageActor()->GetVisibility())
1358 pdmA->SetVisibility(true);
1359 mCursor[0] = mCurrent[0];
1360 mCursor[1] = mCurrent[1];
1361 mCursor[2] = mCurrent[2];
1362 mCursor[3] = mCurrentTSlice;
1365 //----------------------------------------------------------------------------
1368 //----------------------------------------------------------------------------
1369 void vvSlicer::UpdateLandmarks()
1371 vtkPolyData *pd = static_cast<vtkPolyData*>(mLandClipper->GetInput());
1372 if (pd->GetPoints())
1374 mLandGlyph->SetRange(0,1);
1375 mLandGlyph->Modified();
1376 mLandGlyph->Update();
1378 mClipBox->Modified();
1379 mLandClipper->Update();
1380 mLandMapper->Update();
1384 //----------------------------------------------------------------------------
1387 //----------------------------------------------------------------------------
1388 void vvSlicer::SetSlice(int slice)
1390 int *range = this->GetSliceRange();
1393 if (slice < range[0])
1397 else if (slice > range[1])
1403 if (this->Slice == slice)
1408 this->Slice = slice;
1411 this->UpdateDisplayExtent();
1413 // DD("SetSlice de slicer = Render");
1415 // Seems to work without this line
1418 //----------------------------------------------------------------------------
1421 //----------------------------------------------------------------------------
1422 void vvSlicer::SetContourSlice()
1424 if (mSurfaceCutActors.size() > 0)
1425 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
1426 i!=mSurfaceCutActors.end();i++)
1427 (*i)->SetCutSlice((this->Slice)*this->GetImage()->GetSpacing()[this->SliceOrientation]+
1428 this->GetImage()->GetOrigin()[this->SliceOrientation]);
1430 //----------------------------------------------------------------------------
1433 //----------------------------------------------------------------------------
1434 void vvSlicer::ForceUpdateDisplayExtent()
1436 this->UpdateDisplayExtent();
1438 //----------------------------------------------------------------------------
1441 //----------------------------------------------------------------------------
1442 int* vvSlicer::GetDisplayExtent()
1444 return this->GetImageActor()->GetDisplayExtent();
1446 //----------------------------------------------------------------------------
1449 //----------------------------------------------------------------------------
1450 void vvSlicer::PrintSelf(ostream& os, vtkIndent indent)
1452 this->Superclass::PrintSelf(os, indent);
1454 //----------------------------------------------------------------------------