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()
154 return mOverlayMapper.GetPointer();
156 //------------------------------------------------------------------------------
159 //------------------------------------------------------------------------------
160 vvBlendImageActor* vvSlicer::GetOverlayActor()
162 return mOverlayActor.GetPointer();
164 //------------------------------------------------------------------------------
167 //------------------------------------------------------------------------------
168 vtkImageMapToWindowLevelColors* vvSlicer::GetFusionMapper()
170 return mFusionMapper.GetPointer();
172 //------------------------------------------------------------------------------
175 //------------------------------------------------------------------------------
176 vtkImageActor* vvSlicer::GetFusionActor()
178 return mFusionActor.GetPointer();
180 //------------------------------------------------------------------------------
183 //------------------------------------------------------------------------------
184 vtkActor* vvSlicer::GetVFActor()
186 return mVFActor.GetPointer();
188 //------------------------------------------------------------------------------
191 //------------------------------------------------------------------------------
192 vtkCornerAnnotation* vvSlicer::GetAnnotation()
194 return ca.GetPointer();
196 //------------------------------------------------------------------------------
199 //------------------------------------------------------------------------------
200 void vvSlicer::EnableReducedExtent(bool b)
202 mUseReducedExtent = b;
204 //------------------------------------------------------------------------------
207 //------------------------------------------------------------------------------
208 void vvSlicer::SetReducedExtent(int * ext)
210 mReducedExtent = ext;
212 //------------------------------------------------------------------------------
215 //------------------------------------------------------------------------------
216 void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate)
219 mSurfaceCutActors.push_back(new vvMeshActor());
221 mSurfaceCutActors.back()->Init(contour,mCurrentTSlice,mVF);
223 mSurfaceCutActors.back()->Init(contour,mCurrentTSlice);
224 mSurfaceCutActors.back()->SetSlicingOrientation(SliceOrientation);
225 this->GetRenderer()->AddActor(mSurfaceCutActors.back()->GetActor());
229 //------------------------------------------------------------------------------
232 //------------------------------------------------------------------------------
233 void vvSlicer::ToggleContourSuperposition()
235 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
236 i!=mSurfaceCutActors.end(); i++)
237 (*i)->ToggleSuperposition();
239 //------------------------------------------------------------------------------
242 //------------------------------------------------------------------------------
243 void vvSlicer::SetCursorColor(int r,int g, int b)
245 pdmA->GetProperty()->SetColor(r,g,b);
247 //------------------------------------------------------------------------------
250 //------------------------------------------------------------------------------
251 void vvSlicer::SetCursorVisibility(bool s)
253 pdmA->SetVisibility(s);
255 //------------------------------------------------------------------------------
258 //------------------------------------------------------------------------------
259 bool vvSlicer::GetCursorVisibility()
261 return pdmA->GetVisibility();
263 //------------------------------------------------------------------------------
266 //------------------------------------------------------------------------------
267 vvSlicer::~vvSlicer()
269 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
270 i!=mSurfaceCutActors.end(); i++)
273 //------------------------------------------------------------------------------
276 //------------------------------------------------------------------------------
277 void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
284 //------------------------------------------------------------------------------
287 //------------------------------------------------------------------------------
288 void vvSlicer::SetImage(vvImage::Pointer image)
290 if (image->GetVTKImages().size()) {
292 this->Superclass::SetInput(image->GetVTKImages()[0]);
294 // Prevent crash when reload -> change slice if outside extent
296 this->GetInput()->GetWholeExtent(extent);
297 if (SliceOrientation == 0) {
298 if (Slice >= extent[1]) {
299 Slice = (extent[1]-extent[0])/2.0;
302 if (SliceOrientation == 1) {
303 if (Slice >= extent[3]) {
304 Slice = (extent[3]-extent[2])/2.0;
307 if (SliceOrientation == 2) {
308 if (Slice >= extent[5]) {
309 Slice = (extent[5]-extent[4])/2.0;
313 this->UpdateDisplayExtent();
315 ca->SetText(0,mFileName.c_str());
318 //------------------------------------------------------------------------------
321 //------------------------------------------------------------------------------
322 void vvSlicer::SetOverlay(vvImage::Pointer overlay)
324 if (overlay->GetVTKImages().size()) {
328 mOverlayMapper = vtkImageMapToWindowLevelColors::New();
329 mOverlayMapper->SetInput(overlay->GetVTKImages()[0]);
331 if (!mOverlayActor) {
332 mOverlayActor = vvBlendImageActor::New();
333 mOverlayActor->SetInput(mOverlayMapper->GetOutput());
334 mOverlayActor->SetPickable(0);
335 mOverlayActor->SetVisibility(false);
336 mOverlayActor->SetOpacity(0.5);
337 this->UpdateDisplayExtent();
340 //stupid but necessary : the Overlay need to be rendered before fusion
342 this->GetRenderer()->RemoveActor(mFusionActor);
343 this->GetRenderer()->AddActor(mOverlayActor);
344 this->GetRenderer()->AddActor(mFusionActor);
346 this->GetRenderer()->AddActor(mOverlayActor);
349 SetTSlice(mCurrentTSlice);
352 //------------------------------------------------------------------------------
355 //------------------------------------------------------------------------------
356 void vvSlicer::SetFusion(vvImage::Pointer fusion)
358 if (fusion->GetVTKImages().size()) {
362 mFusionMapper = vtkImageMapToWindowLevelColors::New();
363 mFusionMapper->SetInput(fusion->GetVTKImages()[0]);
366 mFusionActor = vtkImageActor::New();
367 mFusionActor->SetInput(mFusionMapper->GetOutput());
368 mFusionActor->SetPickable(0);
369 mFusionActor->SetVisibility(false);
370 mFusionActor->SetOpacity(0.7);
371 this->UpdateDisplayExtent();
372 this->GetRenderer()->AddActor(mFusionActor);
376 SetTSlice(mCurrentTSlice);
379 //------------------------------------------------------------------------------
382 //------------------------------------------------------------------------------
383 void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis)
385 if (actor_type == "vector") {
386 this->mVFActor->SetVisibility(vis);
388 if (actor_type == "overlay") {
389 this->mOverlayActor->SetVisibility(vis);
391 if (actor_type == "fusion") {
392 this->mFusionActor->SetVisibility(vis);
394 if (actor_type == "contour")
395 this->mSurfaceCutActors[overlay_index]->GetActor()->SetVisibility(vis);
396 UpdateDisplayExtent();
398 //------------------------------------------------------------------------------
401 //------------------------------------------------------------------------------
402 void vvSlicer::SetVF(vvImage::Pointer vf)
404 if (vf->GetVTKImages().size()) {
408 mAAFilter=vtkAssignAttribute::New();
409 mVOIFilter = vtkExtractVOI::New();
410 mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
412 mVOIFilter->SetInput(vf->GetVTKImages()[0]);
413 mAAFilter->SetInput(mVOIFilter->GetOutput());
414 ///This tells VTK to use the scalar (pixel) data of the image to draw the little arrows
415 mAAFilter->Assign(vtkDataSetAttributes::SCALARS, vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA);
418 mArrow = vvGlyphSource::New();
419 mArrow->SetGlyphTypeToSpecificArrow();
420 mArrow->SetScale(mScale);
423 // Glyph the gradient vector (with arrows)
425 mGlyphFilter = vvGlyph2D::New();
426 mGlyphFilter->SetInput(mAAFilter->GetOutput());
427 mGlyphFilter->SetSource(mArrow->GetOutput());
428 mGlyphFilter->ScalingOn();
429 mGlyphFilter->SetScaleModeToScaleByVector();
430 mGlyphFilter->OrientOn();
431 mGlyphFilter->SetVectorModeToUseVector();
432 mGlyphFilter->SetColorModeToColorByVector();
435 mVFMapper = vtkPolyDataMapper::New();
436 //mVFMapper->SetInputConnection(mGlyphFilter->GetOutputPort());
437 mVFMapper->SetInput(mGlyphFilter->GetOutput());
438 mVFMapper->ImmediateModeRenderingOn();
441 mVFActor = vtkActor::New();
442 mVFActor->SetMapper(mVFMapper);
443 mVFActor->SetPickable(0);
444 mVFActor->GetProperty()->SetLineWidth(mVFWidth);
445 this->UpdateDisplayExtent();
446 this->GetRenderer()->AddActor(mVFActor);
449 SetTSlice(mCurrentTSlice);
452 //------------------------------------------------------------------------------
455 //------------------------------------------------------------------------------
456 void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
458 mLandmarks = landmarks;
462 mCross = vtkCursor3D::New();
463 mCross->SetFocalPoint(0.0,0.0,0.0);
464 mCross->SetModelBounds(-10,10,-10,10,-10,10);
469 mLandGlyph = vtkGlyph3D::New();
470 mLandGlyph->SetSource(mCross->GetOutput());
471 mLandGlyph->SetInput(landmarks->GetOutput());
472 //mLandGlyph->SetIndexModeToScalar();
473 mLandGlyph->SetRange(0,1);
474 mLandGlyph->ScalingOff();
476 mLandGlyph->SetColorModeToColorByScalar();
479 mClipBox = vtkBox::New();
481 mLandClipper = vtkClipPolyData::New();
482 mLandClipper->InsideOutOn();
483 mLandClipper->SetInput(mLandGlyph->GetOutput());
484 mLandClipper->SetClipFunction(mClipBox);
487 mLandMapper = vtkPolyDataMapper::New();
488 mLandMapper->SetInputConnection(mLandClipper->GetOutputPort());
489 //mLandMapper->ScalarVisibilityOff();
492 mLandActor = vtkActor::New();
493 mLandActor->SetMapper(mLandMapper);
494 mLandActor->GetProperty()->SetColor(255,10,212);
495 mLandActor->SetPickable(0);
496 mLandActor->SetVisibility(true);
497 this->UpdateDisplayExtent();
498 this->GetRenderer()->AddActor(mLandActor);
501 //------------------------------------------------------------------------------
503 //------------------------------------------------------------------------------
504 //FIXME: this function leaks memory, we should fix it someday :)
505 void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
507 if (actor_type == "vector") {
508 Renderer->RemoveActor(mVFActor);
517 if (actor_type == "overlay") {
518 Renderer->RemoveActor(mOverlayActor);
520 mOverlayActor = NULL;
521 mOverlayMapper = NULL;
523 if (actor_type == "fusion") {
524 Renderer->RemoveActor(mFusionActor);
527 mFusionMapper = NULL;
529 if (actor_type == "contour") {
530 Renderer->RemoveActor(this->mSurfaceCutActors[overlay_index]->GetActor());
531 mSurfaceCutActors.erase(mSurfaceCutActors.begin()+overlay_index);
534 //------------------------------------------------------------------------------
537 //------------------------------------------------------------------------------
538 void vvSlicer::SetVFSubSampling(int sub)
541 mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
544 UpdateDisplayExtent();
547 //------------------------------------------------------------------------------
550 //------------------------------------------------------------------------------
551 void vvSlicer::SetVFScale(int scale)
555 mArrow->SetScale(mScale);
556 UpdateDisplayExtent();
559 //------------------------------------------------------------------------------
561 //------------------------------------------------------------------------------
562 void vvSlicer::SetVFWidth(int width)
566 mVFActor->GetProperty()->SetLineWidth(mVFWidth);
567 UpdateDisplayExtent();
570 //------------------------------------------------------------------------------
573 //------------------------------------------------------------------------------
574 void vvSlicer::SetVFLog(int log)
578 mGlyphFilter->SetUseLog(mVFLog);
579 mGlyphFilter->Modified();
581 UpdateDisplayExtent();
584 //------------------------------------------------------------------------------
587 //------------------------------------------------------------------------------
588 void vvSlicer::SetTSlice(int t)
592 else if ((unsigned int)t >= mImage->GetVTKImages().size())
593 t = mImage->GetVTKImages().size() -1;
595 if (mCurrentTSlice == t) return;
598 this->SetInput(mImage->GetVTKImages()[t]);
599 if (mVF && mVFActor->GetVisibility()) {
600 if (mVF->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
601 mVOIFilter->SetInput(mVF->GetVTKImages()[mCurrentTSlice]);
603 if (mOverlay && mOverlayActor->GetVisibility()) {
604 if (mOverlay->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
605 mOverlayMapper->SetInput(mOverlay->GetVTKImages()[mCurrentTSlice]);
607 if (mFusion && mFusionActor->GetVisibility()) {
608 if (mFusion->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
609 mFusionMapper->SetInput(mFusion->GetVTKImages()[mCurrentTSlice]);
611 if (mSurfaceCutActors.size() > 0)
612 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
613 i!=mSurfaceCutActors.end(); i++)
614 (*i)->SetTimeSlice(mCurrentTSlice);
615 UpdateDisplayExtent();
617 //------------------------------------------------------------------------------
620 //------------------------------------------------------------------------------
621 int vvSlicer::GetTSlice()
623 return mCurrentTSlice;
625 //------------------------------------------------------------------------------
628 //------------------------------------------------------------------------------
629 void vvSlicer::SetSliceOrientation(int orientation)
631 //if 2D image, force to watch in Axial View
633 this->GetInput()->GetWholeExtent(extent);
634 if (extent[5]-extent[4] <= 2)
637 if (orientation < vtkImageViewer2::SLICE_ORIENTATION_YZ ||
638 orientation > vtkImageViewer2::SLICE_ORIENTATION_XY) {
639 vtkErrorMacro("Error - invalid slice orientation " << orientation);
643 this->SliceOrientation = orientation;
646 int *range = this->GetSliceRange();
648 this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
650 this->UpdateOrientation();
651 this->UpdateDisplayExtent();
653 if (this->Renderer && this->GetInput()) {
654 double scale = this->Renderer->GetActiveCamera()->GetParallelScale();
655 this->Renderer->ResetCamera();
656 this->Renderer->GetActiveCamera()->SetParallelScale(scale);
661 //----------------------------------------------------------------------------
664 //----------------------------------------------------------------------------
665 int * vvSlicer::GetExtent()
668 if (mUseReducedExtent) {
669 w_ext = mReducedExtent;
670 } else w_ext = GetInput()->GetWholeExtent();
673 //----------------------------------------------------------------------------
676 //----------------------------------------------------------------------------
677 int vvSlicer::GetOrientation()
679 return this->SliceOrientation;
681 //----------------------------------------------------------------------------
684 //----------------------------------------------------------------------------
685 void vvSlicer::UpdateDisplayExtent()
687 vtkImageData *input = this->GetInput();
688 if (!input || !this->ImageActor) {
691 input->UpdateInformation();
692 int *w_ext;// = input->GetWholeExtent();
694 if (mUseReducedExtent) {
695 w_ext = mReducedExtent;
696 } else w_ext = input->GetWholeExtent();
698 switch (this->SliceOrientation) {
699 case vtkImageViewer2::SLICE_ORIENTATION_XY:
700 this->ImageActor->SetDisplayExtent(
701 w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice);
702 if (mVF && mVFActor->GetVisibility()) {
704 ComputeVFDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,vfExtent);
705 mVOIFilter->SetVOI(vfExtent);
706 mGlyphFilter->SetOrientation(1,1,0);
708 // put the vector field between the image and the camera
709 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
710 mVFActor->SetPosition(0,0,ImageActor->GetBounds()[5]+2);
712 mVFActor->SetPosition(0,0,ImageActor->GetBounds()[4]-2);
714 if (mOverlay && mOverlayActor->GetVisibility()) {
716 ComputeOverlayDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,overExtent);
717 mOverlayActor->SetDisplayExtent(overExtent);
718 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
719 mOverlayActor->SetPosition(0,0,1);
721 mOverlayActor->SetPosition(0,0,-1);
723 if (mFusion && mFusionActor->GetVisibility()) {
725 ComputeFusionDisplayedExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], this->Slice, this->Slice,fusExtent);
726 mFusionActor->SetDisplayExtent(fusExtent);
727 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
728 mFusionActor->SetPosition(0,0,1.5);
730 mFusionActor->SetPosition(0,0,-1.5);
735 bounds[0] = ImageActor->GetBounds()[0];
736 bounds[1] = ImageActor->GetBounds()[1];
737 bounds[2] = ImageActor->GetBounds()[2];
738 bounds[3] = ImageActor->GetBounds()[3];
739 bounds[4] = ImageActor->GetBounds()[4]-fabs(0.5/this->GetInput()->GetSpacing()[2]);
740 bounds[5] = ImageActor->GetBounds()[5]+fabs(0.5/this->GetInput()->GetSpacing()[2]);
741 mClipBox->SetBounds(bounds);
744 if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
745 mLandActor->SetPosition(0,0,1.5);
747 mLandActor->SetPosition(0,0,-1.5);
751 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
752 this->ImageActor->SetDisplayExtent(
753 w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5]);
754 if (mVF && mVFActor->GetVisibility()) {
756 ComputeVFDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],vfExtent);
757 mVOIFilter->SetVOI(vfExtent);
758 mGlyphFilter->SetOrientation(1,0,1);
760 // put the vector field between the image aSpacingnd the camera
761 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
762 mVFActor->SetPosition(0,ImageActor->GetBounds()[3]+2,0);
764 mVFActor->SetPosition(0,ImageActor->GetBounds()[2]-2,0);
766 if (mOverlay && mOverlayActor->GetVisibility()) {
768 ComputeOverlayDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],overExtent);
769 mOverlayActor->SetDisplayExtent(overExtent);
770 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
771 mOverlayActor->SetPosition(0,1,0);
773 mOverlayActor->SetPosition(0,-1,0);
775 if (mFusion && mFusionActor->GetVisibility()) {
777 ComputeFusionDisplayedExtent(w_ext[0], w_ext[1], this->Slice, this->Slice, w_ext[4], w_ext[5],fusExtent);
778 mFusionActor->SetDisplayExtent(fusExtent);
779 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
780 mFusionActor->SetPosition(0,1.5,0);
782 mFusionActor->SetPosition(0,-1.5,0);
787 bounds[0] = ImageActor->GetBounds()[0];
788 bounds[1] = ImageActor->GetBounds()[1];
789 bounds[2] = ImageActor->GetBounds()[2]-fabs(0.5/this->GetInput()->GetSpacing()[1]);
790 bounds[3] = ImageActor->GetBounds()[3]+fabs(0.5/this->GetInput()->GetSpacing()[1]);
791 bounds[4] = ImageActor->GetBounds()[4];
792 bounds[5] = ImageActor->GetBounds()[5];
793 mClipBox->SetBounds(bounds);
796 if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
797 mLandActor->SetPosition(0,1.5,0);
799 mLandActor->SetPosition(0,-1.5,0);
803 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
804 this->ImageActor->SetDisplayExtent(
805 this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
806 if (mVF && mVFActor->GetVisibility()) {
808 ComputeVFDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],vfExtent);
809 mVOIFilter->SetVOI(vfExtent);
810 mGlyphFilter->SetOrientation(0,1,1);
812 // put the vector field between the image and the camera
813 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
814 mVFActor->SetPosition(ImageActor->GetBounds()[1]+2,0,0);
816 mVFActor->SetPosition(ImageActor->GetBounds()[0]-2,0,0);
818 if (mOverlay && mOverlayActor->GetVisibility()) {
820 ComputeOverlayDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],overExtent);
821 mOverlayActor->SetDisplayExtent(overExtent);
822 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
823 mOverlayActor->SetPosition(1,0,0);
825 mOverlayActor->SetPosition(-1,0,0);
827 if (mFusion && mFusionActor->GetVisibility()) {
829 ComputeFusionDisplayedExtent(this->Slice, this->Slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5],fusExtent);
830 mFusionActor->SetDisplayExtent(fusExtent);
831 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
832 mFusionActor->SetPosition(1.5,0,0);
834 mFusionActor->SetPosition(-1.5,0,0);
839 bounds[0] = ImageActor->GetBounds()[0]-fabs(0.5/this->GetInput()->GetSpacing()[0]);
840 bounds[1] = ImageActor->GetBounds()[1]+fabs(0.5/this->GetInput()->GetSpacing()[0]);
841 bounds[2] = ImageActor->GetBounds()[2];
842 bounds[3] = ImageActor->GetBounds()[3];
843 bounds[4] = ImageActor->GetBounds()[4];
844 bounds[5] = ImageActor->GetBounds()[5];
845 mClipBox->SetBounds(bounds);
848 if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
849 mLandActor->SetPosition(1.5,0,0);
851 mLandActor->SetPosition(-1.5,0,0);
856 // Figure out the correct clipping range
858 if (this->Renderer) {
859 if (this->InteractorStyle &&
860 this->InteractorStyle->GetAutoAdjustCameraClippingRange()) {
861 this->Renderer->ResetCameraClippingRange();
863 vtkCamera *cam = this->Renderer->GetActiveCamera();
866 this->ImageActor->GetBounds(bounds);
867 double spos = (double)bounds[this->SliceOrientation * 2];
868 double cpos = (double)cam->GetPosition()[this->SliceOrientation];
869 double range = fabs(spos - cpos);
870 double *spacing = input->GetSpacing();
872 ((double)spacing[0] + (double)spacing[1] + (double)spacing[2]) / 3.0;
873 cam->SetClippingRange(
874 range - avg_spacing * 3.0, range + avg_spacing * 3.0);
879 //----------------------------------------------------------------------------
882 //----------------------------------------------------------------------------
883 void vvSlicer::ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int vfExtent[6])
885 vtkImageData* image=this->GetInput();
886 vfExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mVF->GetOrigin()[0]) /
887 mVF->GetSpacing()[0];
888 vfExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mVF->GetOrigin()[0]) /
889 mVF->GetSpacing()[0];
890 vfExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mVF->GetOrigin()[1]) /
891 mVF->GetSpacing()[1];
892 vfExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mVF->GetOrigin()[1]) /
893 mVF->GetSpacing()[1];
894 vfExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mVF->GetOrigin()[2]) /
895 mVF->GetSpacing()[2];
896 vfExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mVF->GetOrigin()[2]) /
897 mVF->GetSpacing()[2];
899 ClipDisplayedExtent(vfExtent,mVOIFilter->GetInput()->GetWholeExtent());
901 //----------------------------------------------------------------------------
904 //----------------------------------------------------------------------------
905 void vvSlicer::ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6])
907 vtkImageData* image=this->GetInput();
908 overExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mOverlay->GetOrigin()[0]) /
909 mOverlay->GetSpacing()[0];
910 overExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mOverlay->GetOrigin()[0]) /
911 mOverlay->GetSpacing()[0];
912 overExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mOverlay->GetOrigin()[1]) /
913 mOverlay->GetSpacing()[1];
914 overExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mOverlay->GetOrigin()[1]) /
915 mOverlay->GetSpacing()[1];
916 overExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mOverlay->GetOrigin()[2]) /
917 mOverlay->GetSpacing()[2];
918 overExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mOverlay->GetOrigin()[2]) /
919 mOverlay->GetSpacing()[2];
920 ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent());
922 //----------------------------------------------------------------------------
925 //----------------------------------------------------------------------------
926 void vvSlicer::ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int fusExtent[6])
928 vtkImageData* image=this->GetInput();
929 fusExtent[0] = (( image->GetOrigin()[0] + x1*image->GetSpacing()[0] ) - mFusion->GetOrigin()[0]) /
930 mFusion->GetSpacing()[0];
931 fusExtent[1] = (( image->GetOrigin()[0] + x2*image->GetSpacing()[0] ) - mFusion->GetOrigin()[0]) /
932 mFusion->GetSpacing()[0];
933 fusExtent[2] = (( image->GetOrigin()[1] + y1*image->GetSpacing()[1] ) - mFusion->GetOrigin()[1]) /
934 mFusion->GetSpacing()[1];
935 fusExtent[3] = (( image->GetOrigin()[1] + y2*image->GetSpacing()[1] ) - mFusion->GetOrigin()[1]) /
936 mFusion->GetSpacing()[1];
937 fusExtent[4] = (( image->GetOrigin()[2] + z1*image->GetSpacing()[2] ) - mFusion->GetOrigin()[2]) /
938 mFusion->GetSpacing()[2];
939 fusExtent[5] = (( image->GetOrigin()[2] + z2*image->GetSpacing()[2] ) - mFusion->GetOrigin()[2]) /
940 mFusion->GetSpacing()[2];
941 ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
943 //----------------------------------------------------------------------------
946 //----------------------------------------------------------------------------
947 void vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
952 //2D overlay on 3D image specific case
953 if (refExtent[4] == refExtent[5]) {
955 extent[4] = refExtent[4];
956 extent[5] = refExtent[5];
959 for (int i = 0; i < maxBound; i = i+2) {
960 //if we are totally outside the image
961 if ( extent[i] > refExtent[i+1] || extent[i+1] < refExtent[i] ) {
965 //crop to the limit of the image
966 extent[i] = (extent[i] > refExtent[i]) ? extent[i] : refExtent[i];
967 extent[i] = (extent[i] < refExtent[i+1]) ? extent[i] : refExtent[i+1];
968 extent[i+1] = (extent[i+1] > refExtent[i]) ? extent[i+1] : refExtent[i];
969 extent[i+1] = (extent[i+1] < refExtent[i+1]) ? extent[i+1] : refExtent[i+1];
972 for (int i = 0; i < maxBound; i = i+2) {
973 extent[i] = refExtent[i];
974 extent[i+1] = refExtent[i];
977 //----------------------------------------------------------------------------
980 //----------------------------------------------------------------------------
981 void vvSlicer::UpdateOrientation()
983 // Set the camera position
984 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
986 switch (this->SliceOrientation) {
987 case vtkImageViewer2::SLICE_ORIENTATION_XY:
988 cam->SetFocalPoint(0,0,0);
989 cam->SetPosition(0,0,-1); // -1 if medical ?
990 cam->SetViewUp(0,-1,0);
993 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
994 cam->SetFocalPoint(0,0,0);
995 cam->SetPosition(0,-1,0); // 1 if medical ?
996 cam->SetViewUp(0,0,1);
999 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
1000 cam->SetFocalPoint(0,0,0);
1001 cam->SetPosition(-1,0,0); // -1 if medical ?
1002 cam->SetViewUp(0,0,1);
1007 //----------------------------------------------------------------------------
1010 //----------------------------------------------------------------------------
1011 void vvSlicer::SetOpacity(double s)
1013 this->GetImageActor()->SetOpacity(s);
1015 //----------------------------------------------------------------------------
1018 //----------------------------------------------------------------------------
1019 void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
1021 this->Superclass::SetRenderWindow(rw);
1022 this->SetupInteractor(rw->GetInteractor());
1023 ca->SetImageActor(this->GetImageActor());
1024 ca->SetWindowLevel(this->GetWindowLevel());
1025 ca->SetText(2, "<slice>");
1026 ca->SetText(3, "<window>\n<level>");
1038 crossCursor->SetModelBounds(bounds);
1039 this->GetRenderer()->AddActor(pdmA);
1040 this->GetRenderer()->AddActor(ca);
1041 this->GetRenderer()->ResetCamera();
1043 //this is just a mapping between the labeling of the orientations presented to the user and
1044 //the one used by vtk
1045 SetSliceOrientation(2-(orientation%3));
1048 //----------------------------------------------------------------------------
1051 //----------------------------------------------------------------------------
1052 void vvSlicer::ResetCamera()
1054 if (this->GetInput()) {
1055 double* input_bounds=this->GetInput()->GetBounds();
1056 double bmax=input_bounds[1]-input_bounds[0];
1057 if (bmax < input_bounds[3]-input_bounds[2]) bmax=input_bounds[3]-input_bounds[2];
1058 if (bmax < input_bounds[5]-input_bounds[4]) bmax=input_bounds[5]-input_bounds[4];
1059 this->GetRenderer()->ResetCamera();
1060 this->GetRenderer()->GetActiveCamera()->SetParallelScale(bmax/2);
1063 //----------------------------------------------------------------------------
1066 //----------------------------------------------------------------------------
1067 void vvSlicer::SetDisplayMode(bool i)
1069 this->GetImageActor()->SetVisibility(i);
1070 this->GetAnnotation()->SetVisibility(i);
1071 this->GetRenderer()->SetDraw(i);
1073 mLandActor->SetVisibility(i);
1074 pdmA->SetVisibility(i);
1076 UpdateDisplayExtent();
1078 //----------------------------------------------------------------------------
1081 //----------------------------------------------------------------------------
1082 void vvSlicer::FlipHorizontalView()
1084 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1086 double *position = cam->GetPosition();
1087 switch (this->SliceOrientation) {
1088 case vtkImageViewer2::SLICE_ORIENTATION_XY:
1089 cam->SetPosition(position[0],position[1],-position[2]);
1092 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
1093 cam->SetPosition(position[0],-position[1],position[2]);
1096 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
1097 cam->SetPosition(-position[0],position[1],position[2]);
1100 this->Renderer->ResetCameraClippingRange();
1101 this->UpdateDisplayExtent();
1104 //----------------------------------------------------------------------------
1107 //----------------------------------------------------------------------------
1108 void vvSlicer::FlipVerticalView()
1110 vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
1112 FlipHorizontalView();
1113 double *viewup = cam->GetViewUp();
1114 cam->SetViewUp(-viewup[0],-viewup[1],-viewup[2]);
1115 this->UpdateDisplayExtent();
1118 //----------------------------------------------------------------------------
1121 //----------------------------------------------------------------------------
1122 void vvSlicer::SetColorWindow(double window)
1124 vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
1126 double level = this->GetWindowLevel()->GetLevel();
1127 LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
1130 this->vtkImageViewer2::SetColorWindow(window);
1132 //----------------------------------------------------------------------------
1135 //----------------------------------------------------------------------------
1136 void vvSlicer::SetColorLevel(double level)
1138 vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
1140 double window = this->GetWindowLevel()->GetWindow();
1141 LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
1144 this->vtkImageViewer2::SetColorLevel(level);
1146 //----------------------------------------------------------------------------
1148 //----------------------------------------------------------------------------
1149 // Returns the min an the max value in a 41x41 region around the mouse pointer
1150 void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
1152 //Get mouse pointer position in view coordinates
1153 double fLocalExtents[6];
1154 for(int i=0; i<3; i++) {
1155 fLocalExtents[i*2 ] = mCurrent[i];
1156 fLocalExtents[i*2+1] = mCurrent[i];
1158 this->Renderer->WorldToView(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
1159 this->Renderer->WorldToView(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
1160 for(int i=0; i<3; i++) {
1161 if (i!=SliceOrientation) { //SR: assumes that SliceOrientation is valid in ViewCoordinates (???)
1162 fLocalExtents[i*2 ] -= 0.2;
1163 fLocalExtents[i*2+1] += 0.2;
1166 this->Renderer->ViewToWorld(fLocalExtents[0], fLocalExtents[2], fLocalExtents[4]);
1167 this->Renderer->ViewToWorld(fLocalExtents[1], fLocalExtents[3], fLocalExtents[5]);
1169 //Convert to image pixel coordinates (rounded)
1170 int iLocalExtents[6];
1171 for(int i=0; i<3; i++) {
1172 fLocalExtents[i*2 ] = (fLocalExtents[i*2 ] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
1173 fLocalExtents[i*2+1] = (fLocalExtents[i*2+1] - this->GetInput()->GetOrigin()[i])/this->GetInput()->GetSpacing()[i];
1175 iLocalExtents[i*2 ] = lrint(fLocalExtents[i*2 ]);
1176 iLocalExtents[i*2+1] = lrint(fLocalExtents[i*2+1]);
1178 if(iLocalExtents[i*2 ]>iLocalExtents[i*2+1])
1179 std::swap(iLocalExtents[i*2], iLocalExtents[i*2+1]);
1182 vtkSmartPointer<vtkExtractVOI> voiFilter = vtkExtractVOI::New();
1183 voiFilter->SetInput(this->GetInput());
1184 voiFilter->SetVOI(iLocalExtents);
1185 voiFilter->Update();
1186 if (!voiFilter->GetOutput()->GetNumberOfPoints()) {
1192 vtkSmartPointer<vtkImageAccumulate> accFilter = vtkImageAccumulate::New();
1193 accFilter->SetInput(voiFilter->GetOutput());
1194 accFilter->Update();
1196 min = *(accFilter->GetMin());
1197 max = *(accFilter->GetMax());
1199 //----------------------------------------------------------------------------
1201 //----------------------------------------------------------------------------
1202 void vvSlicer::Render()
1204 // DD("vvSlicer::Render");
1205 // DD(SliceOrientation);
1206 if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion) {
1207 legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable());
1208 legend->SetVisibility(1);
1209 } else legend->SetVisibility(0);
1211 if (ca->GetVisibility()) {
1212 std::string worldPos = "";
1213 std::stringstream world1;
1214 std::stringstream world2;
1215 std::stringstream world3;
1216 world1 << (int)mCurrent[0];
1217 world2 << (int)mCurrent[1];
1218 world3 << (int)mCurrent[2];
1219 double X = (mCurrent[0] - this->GetInput()->GetOrigin()[0])/this->GetInput()->GetSpacing()[0];
1220 double Y = (mCurrent[1] - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
1221 double Z = (mCurrent[2] - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
1223 if (pdmA->GetVisibility()) {
1224 double x = mCursor[0];
1225 double y = mCursor[1];
1226 double z = mCursor[2];
1227 double xCursor = (x - this->GetInput()->GetOrigin()[0])/this->GetInput()->GetSpacing()[0];
1228 double yCursor = (y - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
1229 double zCursor = (z - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
1231 if (xCursor >= this->GetImageActor()->GetDisplayExtent()[0] &&
1232 xCursor < this->GetImageActor()->GetDisplayExtent()[1]+1 &&
1233 yCursor >= this->GetImageActor()->GetDisplayExtent()[2] &&
1234 yCursor < this->GetImageActor()->GetDisplayExtent()[3]+1 &&
1235 zCursor >= this->GetImageActor()->GetDisplayExtent()[4] &&
1236 zCursor < this->GetImageActor()->GetDisplayExtent()[5]+1 ) {
1237 vtkRenderer * renderer = this->Renderer;
1239 renderer->WorldToView(x,y,z);
1240 renderer->ViewToNormalizedViewport(x,y,z);
1241 renderer->NormalizedViewportToViewport(x,y);
1242 renderer->ViewportToNormalizedDisplay(x,y);
1243 renderer->NormalizedDisplayToDisplay(x,y);
1244 crossCursor->SetFocalPoint(x,y,z);
1246 crossCursor->SetFocalPoint(-1,-1,z);
1249 if (X >= this->GetInput()->GetWholeExtent()[0] &&
1250 X <= this->GetInput()->GetWholeExtent()[1] &&
1251 Y >= this->GetInput()->GetWholeExtent()[2] &&
1252 Y <= this->GetInput()->GetWholeExtent()[3] &&
1253 Z >= this->GetInput()->GetWholeExtent()[4] &&
1254 Z <= this->GetInput()->GetWholeExtent()[5]) {
1255 std::stringstream pixel1;
1256 std::stringstream pixel2;
1257 std::stringstream pixel3;
1258 std::stringstream temps;
1262 temps << mCurrentTSlice;
1263 double value = this->GetInput()->GetScalarComponentAsDouble(lrint(X),
1267 std::stringstream val;
1269 worldPos += "data value : " + val.str();
1270 worldPos += "\n mm : " + world1.str() + " " + world2.str() + " " +
1271 world3.str() + " " + temps.str();
1272 worldPos += "\n pixel : " + pixel1.str() + " " + pixel2.str() + " " +
1273 pixel3.str() + " " + temps.str();
1275 ca->SetText(1,worldPos.c_str());
1277 if (mOverlay && mOverlayActor->GetVisibility()) {
1278 mOverlayMapper->SetWindow(this->GetColorWindow());
1279 mOverlayMapper->SetLevel(this->GetColorLevel());
1280 mOverlayMapper->Update();
1284 //this->Superclass::Render();
1285 this->GetRenderWindow()->Render();
1287 //----------------------------------------------------------------------------
1290 //----------------------------------------------------------------------------
1291 void vvSlicer::UpdateCursorPosition()
1293 if (this->GetImageActor()->GetVisibility()) {
1294 pdmA->SetVisibility(true);
1295 mCursor[0] = mCurrent[0];
1296 mCursor[1] = mCurrent[1];
1297 mCursor[2] = mCurrent[2];
1298 mCursor[3] = mCurrentTSlice;
1301 //----------------------------------------------------------------------------
1304 //----------------------------------------------------------------------------
1305 void vvSlicer::UpdateLandmarks()
1307 vtkPolyData *pd = static_cast<vtkPolyData*>(mLandClipper->GetInput());
1308 if (pd->GetPoints()) {
1309 mLandGlyph->SetRange(0,1);
1310 mLandGlyph->Modified();
1311 mLandGlyph->Update();
1313 mClipBox->Modified();
1314 mLandClipper->Update();
1315 mLandMapper->Update();
1319 //----------------------------------------------------------------------------
1322 //----------------------------------------------------------------------------
1323 void vvSlicer::SetSlice(int slice)
1325 int *range = this->GetSliceRange();
1327 if (slice < range[0]) {
1329 } else if (slice > range[1]) {
1334 if (this->Slice == slice) {
1338 this->Slice = slice;
1341 this->UpdateDisplayExtent();
1343 // DD("SetSlice de slicer = Render");
1345 // Seems to work without this line
1348 //----------------------------------------------------------------------------
1351 //----------------------------------------------------------------------------
1352 void vvSlicer::SetContourSlice()
1354 if (mSurfaceCutActors.size() > 0)
1355 for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
1356 i!=mSurfaceCutActors.end(); i++)
1357 (*i)->SetCutSlice((this->Slice)*this->GetImage()->GetSpacing()[this->SliceOrientation]+
1358 this->GetImage()->GetOrigin()[this->SliceOrientation]);
1360 //----------------------------------------------------------------------------
1363 //----------------------------------------------------------------------------
1364 void vvSlicer::ForceUpdateDisplayExtent()
1366 this->UpdateDisplayExtent();
1368 //----------------------------------------------------------------------------
1371 //----------------------------------------------------------------------------
1372 int* vvSlicer::GetDisplayExtent()
1374 return this->GetImageActor()->GetDisplayExtent();
1376 //----------------------------------------------------------------------------
1379 //----------------------------------------------------------------------------
1380 void vvSlicer::PrintSelf(ostream& os, vtkIndent indent)
1382 this->Superclass::PrintSelf(os, indent);
1384 //----------------------------------------------------------------------------