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 ======================================================================-====*/
19 #include "vvSlicerManager.h"
22 #include "vvSlicerManagerCommand.h"
23 #include "vvInteractorStyleNavigator.h"
24 #include "vvLandmarks.h"
26 #include "vvImageMapToWLColors.h"
27 #include "vvBlendImageActor.h"
29 #include <vtkImageActor.h>
30 #include <vtkImageData.h>
31 #include <vtkRenderWindow.h>
32 #include <vtkRendererCollection.h>
33 #include <vtkRenderWindowInteractor.h>
34 #include <vtkImageMapToWindowLevelColors.h>
35 #include <vtkWindowLevelLookupTable.h>
36 #include <vtkColorTransferFunction.h>
37 #include <vtkImageClip.h>
38 #include <vtkLODActor.h>
39 #include <vtkPointData.h>
40 #include <vtksys/SystemTools.hxx>
41 #include <vtkCamera.h>
43 #include <qfileinfo.h>
45 //----------------------------------------------------------------------------
46 vvSlicerManager::vvSlicerManager(int numberOfSlicers)
55 mType = vvImageReader::UNDEFINEDIMAGETYPE;
61 mFusionThresOpacity = 1;
69 for ( int i = 0; i < numberOfSlicers; i++)
70 mSlicers.push_back(vtkSmartPointer<vvSlicer>::New());
72 mPreviousSlice.resize(numberOfSlicers);
73 mPreviousTSlice.resize(numberOfSlicers);
75 //----------------------------------------------------------------------------
78 //----------------------------------------------------------------------------
79 vvSlicerManager::~vvSlicerManager()
84 //----------------------------------------------------------------------------
87 //------------------------------------------------------------------------------
88 void vvSlicerManager::SetFilename(std::string filename, int number)
91 mFileName = vtksys::SystemTools::GetFilenameName(mFileName);
92 mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));
93 mBaseFileNameNumber = number;
95 mFileName = mBaseFileName;
97 mFileName.append("_"+clitk::toString(number));
99 mFileName.append(vtksys::SystemTools::GetFilenameLastExtension(filename));
101 for(unsigned int i=0; i<mSlicers.size(); i++) {
102 mSlicers[i]->SetFileName(mFileName);//vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
106 //------------------------------------------------------------------------------
109 //----------------------------------------------------------------------------
110 void vvSlicerManager::AddContour(vvMesh::Pointer contour,bool propagate)
112 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
113 mSlicers[i]->AddContour(contour,propagate);
116 //----------------------------------------------------------------------------
119 //----------------------------------------------------------------------------
120 void vvSlicerManager::ToggleContourSuperposition()
122 for ( unsigned int i = 0; i < mSlicers.size(); i++)
123 mSlicers[i]->ToggleContourSuperposition();
125 //----------------------------------------------------------------------------
127 //----------------------------------------------------------------------------
128 std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::string &actorType)
130 vvImageReader *reader = NULL;
132 if(actorType=="image")
134 else if(actorType=="overlay")
135 reader = mOverlayReader;
136 else if(actorType=="fusion")
137 reader = mFusionReader;
138 else if(actorType=="vector")
139 reader = mVectorReader;
145 for(unsigned int i=0; i<reader->GetInputFilenames().size(); i++){
146 QFileInfo fileinfo(reader->GetInputFilenames()[i].c_str()); //Do not show the path
149 list += fileinfo.absoluteFilePath().toStdString();
153 //----------------------------------------------------------------------------
156 //----------------------------------------------------------------------------
157 bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageType type, int n, unsigned int slice)
160 if (mReader.IsNull())
161 mReader = vvImageReader::New();
162 std::vector<std::string> filenames;
163 filenames.push_back(filename);
164 mReader->SetInputFilenames(filenames);
165 mReader->SetSlice(slice); // Only used for SLICED type
166 mReader->Update(type);
168 SetFilename(filename, n);
169 // mFileName = vtksys::SystemTools::GetFilenameName(mFileName);
170 //mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));
171 //mBaseFileNameNumber = n;
173 if (mReader->GetLastError().size() == 0) {
174 mImage=mReader->GetOutput();
175 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
176 mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
177 mSlicers[i]->SetImage(mReader->GetOutput());
180 mLastError = mReader->GetLastError();
184 // mFileName.append("_"+clitk::toString(n));
188 //----------------------------------------------------------------------------
191 //----------------------------------------------------------------------------
192 void vvSlicerManager::SetImage(vvImage::Pointer image)
195 for (unsigned int i = 0; i < mSlicers.size(); i++) {
196 mSlicers[i]->SetImage(image);
199 //----------------------------------------------------------------------------
202 //----------------------------------------------------------------------------
203 bool vvSlicerManager::SetImages(std::vector<std::string> filenames, vvImageReader::LoadedImageType type, int n)
206 std::string fileWithoutExtension = vtksys::SystemTools::GetFilenameWithoutExtension(filenames[0]);
207 if (type == vvImageReader::DICOM)
208 fileWithoutExtension += "_dicom";
209 else if (type == vvImageReader::MERGED)
210 fileWithoutExtension += "_merged";
211 else if (type == vvImageReader::MERGEDWITHTIME)
212 fileWithoutExtension += "_merged_wt";
214 mFileName = vtksys::SystemTools::GetFilenameName(mFileName);
215 mFileName = fileWithoutExtension + vtksys::SystemTools::GetFilenameExtension(filenames[0]);
216 if (mReader.IsNull())
217 mReader = vvImageReader::New();
218 mReader->SetInputFilenames(filenames);
219 mReader->Update(type);
221 mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));
222 mBaseFileNameNumber = n;
224 if (mReader->GetLastError().size() == 0) {
225 mImage=mReader->GetOutput();
226 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
227 mSlicers[i]->SetFileName(fileWithoutExtension);
228 mSlicers[i]->SetImage(mReader->GetOutput());
231 mLastError = mReader->GetLastError();
235 mFileName.append("_"+clitk::toString(n));
239 //----------------------------------------------------------------------------
242 //----------------------------------------------------------------------------
243 bool vvSlicerManager::SetOverlay(std::string filename,int dim, std::string component)
245 mOverlayName = filename;
246 mOverlayComponent = component;
247 if (dim > mImage->GetNumberOfDimensions()) {
248 mLastError = " Overlay dimension cannot be greater then reference image!";
251 if (mOverlayReader.IsNull())
252 mOverlayReader = vvImageReader::New();
253 std::vector<std::string> filenames;
254 filenames.push_back(filename);
255 mOverlayReader->SetInputFilenames(filenames);
256 mOverlayReader->Update(mImage->GetNumberOfDimensions(),component.c_str(),mType);
257 if (mOverlayReader->GetLastError().size() == 0) {
258 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
259 mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
262 mLastError = mOverlayReader->GetLastError();
267 //----------------------------------------------------------------------------
270 //----------------------------------------------------------------------------
271 bool vvSlicerManager::SetFusion(std::string filename,int dim, std::string component)
273 mFusionName = filename;
274 mFusionComponent = component;
275 if (dim > mImage->GetNumberOfDimensions()) {
276 mLastError = " Overlay dimension cannot be greater then reference image!";
279 if (mFusionReader.IsNull())
280 mFusionReader = vvImageReader::New();
281 std::vector<std::string> filenames;
282 filenames.push_back(filename);
283 mFusionReader->SetInputFilenames(filenames);
284 mFusionReader->Update(mImage->GetNumberOfDimensions(),component.c_str(),mType);
285 if (mFusionReader->GetLastError().size() == 0) {
286 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
287 mSlicers[i]->SetFusion(mFusionReader->GetOutput());
290 mLastError = mFusionReader->GetLastError();
293 double *fusRange = mFusionReader->GetOutput()->GetVTKImages()[0]->GetScalarRange();
294 mFusionLevel = (fusRange[0]+fusRange[1])/2;
295 mFusionWindow = fusRange[1]-fusRange[0];
299 //----------------------------------------------------------------------------
302 //----------------------------------------------------------------------------
303 bool vvSlicerManager::SetVF(std::string filename)
305 if (mVectorReader.IsNull())
306 mVectorReader = vvImageReader::New();
307 mVectorReader->SetInputFilename(filename);
309 if (mType == vvImageReader::IMAGEWITHTIME)
310 mVectorReader->Update(vvImageReader::VECTORFIELDWITHTIME);
312 mVectorReader->Update(vvImageReader::VECTORFIELD);
313 if (mVectorReader->GetLastError().size() != 0) {
314 mLastError = mVectorReader->GetLastError();
317 return SetVF(mVectorReader->GetOutput(),filename);
319 //----------------------------------------------------------------------------
322 //----------------------------------------------------------------------------
323 bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename)
325 if (vf->GetNumberOfDimensions() > mImage->GetNumberOfDimensions()) {
326 mLastError = "Sorry, vector field dimension cannot be greater then reference image.";
329 if (vf->GetNumberOfDimensions() == 4) {
330 if (vf->GetSpacing()[3] != mImage->GetSpacing()[3]) {
331 mLastError = "Sorry, vector field time spacing cannot be different from time spacing of the reference image.";
334 if (vf->GetOrigin()[3] != mImage->GetOrigin()[3]) {
335 mLastError = "Sorry, vector field time origin cannot be different from time origin of the reference image.";
341 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
342 mSlicers[i]->SetVF(vf);
346 //----------------------------------------------------------------------------
349 //----------------------------------------------------------------------------
350 vvSlicer* vvSlicerManager::GetSlicer(int i)
354 //----------------------------------------------------------------------------
357 //----------------------------------------------------------------------------
358 void vvSlicerManager::UpdateSlicer(int num, bool state)
360 if (mSlicers[num]->GetImage())
361 mSlicers[num]->SetDisplayMode(state);
363 //----------------------------------------------------------------------------
366 //----------------------------------------------------------------------------
367 void vvSlicerManager::SetSlicerWindow(int i, vtkRenderWindow* RW)
369 mSlicers[i]->SetRenderWindow(i,RW);
371 //----------------------------------------------------------------------------
374 //----------------------------------------------------------------------------
375 void vvSlicerManager::SetInteractorStyleNavigator(int i, vtkInteractorStyle* style)
377 vvSlicerManagerCommand *smc = vvSlicerManagerCommand::New();
379 smc->SetSlicerNumber(i);
380 mSlicers[i]->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
382 mSlicers[i]->GetRenderWindow()->GetInteractor()->
383 GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, smc);
384 mSlicers[i]->GetRenderWindow()->GetInteractor()->
385 GetInteractorStyle()->AddObserver(vtkCommand::WindowLevelEvent, smc);
386 mSlicers[i]->GetRenderWindow()->GetInteractor()->
387 GetInteractorStyle()->AddObserver(vtkCommand::EndWindowLevelEvent, smc);
388 mSlicers[i]->GetRenderWindow()->GetInteractor()->
389 GetInteractorStyle()->AddObserver(vtkCommand::StartWindowLevelEvent, smc);
390 mSlicers[i]->GetRenderWindow()->GetInteractor()->
391 GetInteractorStyle()->AddObserver(vtkCommand::PickEvent, smc);
392 mSlicers[i]->GetRenderWindow()->GetInteractor()->
393 GetInteractorStyle()->AddObserver(vtkCommand::StartPickEvent, smc);
394 mSlicers[i]->GetRenderWindow()->GetInteractor()->
395 GetInteractorStyle()->AddObserver(vtkCommand::LeaveEvent, smc);
396 mSlicers[i]->GetRenderWindow()->GetInteractor()->
397 GetInteractorStyle()->AddObserver(vtkCommand::UserEvent, smc);
398 mSlicers[i]->GetRenderWindow()->GetInteractor()->
399 GetInteractorStyle()->AddObserver(vtkCommand::MouseWheelForwardEvent, smc);
400 mSlicers[i]->GetRenderWindow()->GetInteractor()->
401 GetInteractorStyle()->AddObserver(vtkCommand::MouseWheelBackwardEvent, smc);
402 // mSlicers[i]->GetRenderWindow()->GetInteractor()->
403 // GetInteractorStyle()->AddObserver(vtkCommand::LeftButtonReleaseEvent, smc);
404 mSlicers[i]->GetRenderWindow()->GetInteractor()->
405 GetInteractorStyle()->AddObserver(vtkCommand::EndPickEvent, smc);
406 mSlicers[i]->GetRenderWindow()->GetInteractor()->
407 GetInteractorStyle()->AddObserver(vtkCommand::EndInteractionEvent, smc);
410 //----------------------------------------------------------------------------
413 //----------------------------------------------------------------------------
414 void vvSlicerManager::LeftButtonReleaseEvent(int slicer)
416 emit LeftButtonReleaseSignal(slicer);
418 //----------------------------------------------------------------------------
420 //----------------------------------------------------------------------------
421 void vvSlicerManager::SetSliceOrientation(int slicer, int orientation)
423 mSlicers[slicer]->SetSliceOrientation(orientation);
424 emit UpdateOrientation(slicer, orientation);
426 //----------------------------------------------------------------------------
428 //----------------------------------------------------------------------------
429 void vvSlicerManager::SetTSlice(int slice)
433 else if (slice > mSlicers[0]->GetTMax())
434 slice = mSlicers[0]->GetTMax();
436 mLandmarks->SetTime(slice);
437 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
438 if (slice != mSlicers[i]->GetTSlice()) {
439 mSlicers[i]->SetTSlice(slice);
444 //----------------------------------------------------------------------------
447 //----------------------------------------------------------------------------
448 void vvSlicerManager::SetNextTSlice(int originating_slicer)
450 int t = mSlicers[0]->GetTSlice();
452 if (t > mSlicers[0]->GetTMax())
454 //std::cout << "vvSlicerManager::SetNextTSlice" << std::endl;
455 emit UpdateTSlice(originating_slicer,t);
457 //----------------------------------------------------------------------------
460 //----------------------------------------------------------------------------
461 void vvSlicerManager::SetPreviousTSlice(int originating_slicer)
463 int t = mSlicers[0]->GetTSlice();
466 t = mSlicers[0]->GetTMax();
467 //std::cout << "vvSlicerManager::SetPreviousTSlice" << std::endl;
468 emit UpdateTSlice(originating_slicer,t);
470 //----------------------------------------------------------------------------
473 //----------------------------------------------------------------------------
474 void vvSlicerManager::ToggleInterpolation()
476 bool interpolate=!(mSlicers[0]->GetImageActor()->GetInterpolate());
477 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
478 mSlicers[i]->GetImageActor()->SetInterpolate(interpolate);
479 if (mSlicers[i]->GetOverlayActor())
480 mSlicers[i]->GetOverlayActor()->SetInterpolate(interpolate);
481 if (mSlicers[i]->GetFusionActor())
482 mSlicers[i]->GetFusionActor()->SetInterpolate(interpolate);
485 //----------------------------------------------------------------------------
488 //----------------------------------------------------------------------------
489 void vvSlicerManager::SetTSliceInSlicer(int tslice, int slicer)
493 else if (tslice > mSlicers[slicer]->GetTMax())
494 tslice = mSlicers[slicer]->GetTMax();
496 mLandmarks->SetTime(tslice);
498 if (mSlicers[slicer]->GetTSlice() == tslice) return;
500 mSlicers[slicer]->SetTSlice(tslice);
501 UpdateTSlice(slicer);
503 //----------------------------------------------------------------------------
506 //----------------------------------------------------------------------------
507 void vvSlicerManager::SetColorWindow(double s)
509 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
510 mSlicers[i]->SetColorWindow(s);
513 //----------------------------------------------------------------------------
515 //----------------------------------------------------------------------------
516 void vvSlicerManager::SetColorLevel(double s)
518 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
519 mSlicers[i]->SetColorLevel(s);
522 //----------------------------------------------------------------------------
524 //----------------------------------------------------------------------------
525 void vvSlicerManager::SetOverlayColorWindow(double s)
527 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
528 mSlicers[i]->SetOverlayColorWindow(s);
531 //----------------------------------------------------------------------------
533 //----------------------------------------------------------------------------
534 void vvSlicerManager::SetOverlayColorLevel(double s)
536 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
537 mSlicers[i]->SetOverlayColorLevel(s);
540 //----------------------------------------------------------------------------
542 //----------------------------------------------------------------------------
543 void vvSlicerManager::SetLinkOverlayWindowLevel(bool b)
545 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
546 mSlicers[i]->SetLinkOverlayWindowLevel(b);
549 //----------------------------------------------------------------------------
551 //----------------------------------------------------------------------------
552 void vvSlicerManager::SetCursorAndCornerAnnotationVisibility(int s)
554 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
555 mSlicers[i]->SetCursorVisibility(s);
556 mSlicers[i]->SetCornerAnnotationVisibility(s);
559 //----------------------------------------------------------------------------
561 //----------------------------------------------------------------------------
562 void vvSlicerManager::SetOpacity(int i, double factor)
564 mSlicers[i]->SetOpacity(1/factor);
566 //----------------------------------------------------------------------------
569 //----------------------------------------------------------------------------
570 void vvSlicerManager::UpdateViews(int current,int slicer)
572 double x = (mSlicers[slicer]->GetCurrentPosition()[0] - mSlicers[slicer]->GetInput()->GetOrigin()[0])
573 /mSlicers[slicer]->GetInput()->GetSpacing()[0];
574 double y = (mSlicers[slicer]->GetCurrentPosition()[1] - mSlicers[slicer]->GetInput()->GetOrigin()[1])
575 /mSlicers[slicer]->GetInput()->GetSpacing()[1];
576 double z = (mSlicers[slicer]->GetCurrentPosition()[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2])
577 /mSlicers[slicer]->GetInput()->GetSpacing()[2];
579 if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
580 x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
581 y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
582 y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
583 z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
584 z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5]) {
585 mSlicers[slicer]->UpdateCursorPosition();
586 mSlicers[slicer]->SetCursorColor(10,212,255);
588 switch (mSlicers[slicer]->GetSliceOrientation()) {
589 case vtkImageViewer2::SLICE_ORIENTATION_XY:
590 if (mSlicers[slicer]->GetSlice() != (int)floor(z))
591 mSlicers[slicer]->SetSlice((int)floor(z));
594 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
595 if (mSlicers[slicer]->GetSlice() != (int)floor(y))
596 mSlicers[slicer]->SetSlice((int)floor(y));
599 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
600 if (mSlicers[slicer]->GetSlice() != (int)floor(x))
601 mSlicers[slicer]->SetSlice((int)floor(x));
604 mSlicers[slicer]->Render();
606 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
607 if (i != (unsigned int)slicer
608 && mSlicers[i]->GetRenderer()->GetDraw()
609 && mSlicers[i]->GetRenderWindow()->GetSize()[0] > 2
610 && mSlicers[i]->GetRenderWindow()->GetSize()[1] > 2) {
611 mSlicers[i]->SetCurrentPosition(mSlicers[slicer]->GetCurrentPosition()[0],
612 mSlicers[slicer]->GetCurrentPosition()[1],
613 mSlicers[slicer]->GetCurrentPosition()[2],
614 mSlicers[slicer]->GetTSlice());
615 mSlicers[i]->UpdateCursorPosition();
616 if (current) { //do not display corner annotation if image is the one picked
617 mSlicers[i]->SetCurrentPosition(-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX,
618 -VTK_DOUBLE_MAX, mSlicers[slicer]->GetTSlice());
619 mSlicers[i]->SetCursorColor(255,10,212);
621 mSlicers[i]->SetCursorColor(150,10,282);
623 switch (mSlicers[i]->GetSliceOrientation()) {
624 case vtkImageViewer2::SLICE_ORIENTATION_XY:
625 if (mSlicers[i]->GetSlice() != (int)floor(z))
626 mSlicers[i]->SetSlice((int)floor(z));
629 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
630 if (mSlicers[i]->GetSlice() != (int)floor(y))
631 mSlicers[i]->SetSlice((int)floor(y));
634 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
635 if (mSlicers[i]->GetSlice() != (int)floor(x))
636 mSlicers[i]->SetSlice((int)floor(x));
640 mSlicers[i]->Render();
648 //----------------------------------------------------------------------------
651 //----------------------------------------------------------------------------
652 void vvSlicerManager::UpdateLinked(int slicer)
654 double x = (mSlicers[slicer]->GetCurrentPosition()[0] - mSlicers[slicer]->GetInput()->GetOrigin()[0])
655 /mSlicers[slicer]->GetInput()->GetSpacing()[0];
656 double y = (mSlicers[slicer]->GetCurrentPosition()[1] - mSlicers[slicer]->GetInput()->GetOrigin()[1])
657 /mSlicers[slicer]->GetInput()->GetSpacing()[1];
658 double z = (mSlicers[slicer]->GetCurrentPosition()[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2])
659 /mSlicers[slicer]->GetInput()->GetSpacing()[2];
661 if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
662 x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
663 y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
664 y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
665 z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
666 z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5]) {
667 for (std::list<std::string>::const_iterator i = mLinkedId.begin(); i != mLinkedId.end(); i++) {
668 emit UpdateLinkManager(*i, slicer,mSlicers[slicer]->GetCurrentPosition()[0],
669 mSlicers[slicer]->GetCurrentPosition()[1],
670 mSlicers[slicer]->GetCurrentPosition()[2],mSlicers[slicer]->GetTSlice());
674 //----------------------------------------------------------------------------
676 //----------------------------------------------------------------------------
677 void vvSlicerManager::UpdateLinkedNavigation(vvSlicer *refSlicer, bool bPropagate)
679 vtkCamera *refCam = refSlicer->GetRenderer()->GetActiveCamera();
680 double refPosition[3], refFocal[3];
681 refCam->GetPosition(refPosition);
682 refCam->GetFocalPoint(refFocal);
684 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
685 vtkCamera *camera = mSlicers[i]->GetRenderer()->GetActiveCamera();
686 camera->SetParallelScale(refCam->GetParallelScale());
688 double position[3], focal[3];
689 camera->GetPosition(position);
690 camera->GetFocalPoint(focal);
692 if(refSlicer->GetSliceOrientation()==mSlicers[i]->GetSliceOrientation()) {
693 for(int i=0; i<3; i++) {
694 position[i] = refPosition[i];
695 focal[i] = refFocal[i];
699 if(refSlicer->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_XY) {
700 if(mSlicers[i]->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_XZ) {
701 position[0] = refPosition[0];
702 focal[0] = refFocal[0];
704 if(mSlicers[i]->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_YZ) {
705 position[1] = refPosition[1];
706 focal[1] = refFocal[1];
710 if(refSlicer->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_XZ) {
711 if(mSlicers[i]->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_YZ) {
712 position[2] = refPosition[2];
713 focal[2] = refFocal[2];
715 if(mSlicers[i]->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_XY) {
716 position[0] = refPosition[0];
717 focal[0] = refFocal[0];
721 if(refSlicer->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_YZ) {
722 if(mSlicers[i]->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_XY) {
723 position[1] = refPosition[1];
724 focal[1] = refFocal[1];
726 if(mSlicers[i]->GetSliceOrientation()==vtkImageViewer2::SLICE_ORIENTATION_XZ) {
727 position[2] = refPosition[2];
728 focal[2] = refFocal[2];
732 camera->SetFocalPoint(focal);
733 camera->SetPosition(position);
736 mSlicers[i]->ForceUpdateDisplayExtent();
741 for (std::list<std::string>::const_iterator i = mLinkedId.begin(); i != mLinkedId.end(); i++)
742 emit UpdateLinkedNavigation(*i, this, refSlicer);
744 //----------------------------------------------------------------------------
746 //----------------------------------------------------------------------------
747 double vvSlicerManager::GetColorWindow()
750 return mSlicers[0]->GetColorWindow();
753 //----------------------------------------------------------------------------
756 //----------------------------------------------------------------------------
757 double vvSlicerManager::GetColorLevel()
760 return mSlicers[0]->GetColorLevel();
763 //----------------------------------------------------------------------------
765 //----------------------------------------------------------------------------
766 double vvSlicerManager::GetOverlayColorWindow() const
769 return mSlicers[0]->GetOverlayColorWindow();
772 //----------------------------------------------------------------------------
774 //----------------------------------------------------------------------------
775 double vvSlicerManager::GetOverlayColorLevel() const
778 return mSlicers[0]->GetOverlayColorLevel();
781 //----------------------------------------------------------------------------
783 //----------------------------------------------------------------------------
784 bool vvSlicerManager::GetLinkOverlayWindowLevel() const
787 return mSlicers[0]->GetLinkOverlayWindowLevel();
790 //----------------------------------------------------------------------------
792 //------------------------------------------------------------------------------
793 void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType)
795 if(actorType == "image")
796 this->GetImage()->GetTransform()->Identity();
797 else if(actorType == "overlay")
798 this->GetSlicer(0)->GetOverlay()->GetTransform()->Identity();
799 else if(actorType == "fusion")
800 this->GetSlicer(0)->GetFusion()->GetTransform()->Identity();
801 else if(actorType == "vf")
802 this->GetVF()->GetTransform()->Identity();
806 for(int i=0; i< this->GetNumberOfSlicers(); i++){
807 this->GetSlicer(i)->ForceUpdateDisplayExtent();
808 this->GetSlicer(i)->ResetCamera();
809 this->GetSlicer(i)->Render();
812 //------------------------------------------------------------------------------
814 //----------------------------------------------------------------------------
815 void vvSlicerManager::Render()
817 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
818 mSlicers[i]->Render();
821 //----------------------------------------------------------------------------
824 //----------------------------------------------------------------------------
825 void vvSlicerManager::GenerateDefaultLookupTable()
828 SetColorMap(mColorMap);
830 //----------------------------------------------------------------------------
833 //----------------------------------------------------------------------------
834 void vvSlicerManager::Reload()
836 mReader->Update(mType);
837 mImage=mReader->GetOutput();
838 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
839 mSlicers[i]->SetImage(mImage);
842 //----------------------------------------------------------------------------
845 //----------------------------------------------------------------------------
846 void vvSlicerManager::ReloadFusion()
848 mFusionReader->Update();
849 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
850 mSlicers[i]->SetFusion(mFusionReader->GetOutput());
851 mSlicers[i]->Render();
854 //----------------------------------------------------------------------------
857 //----------------------------------------------------------------------------
858 void vvSlicerManager::ReloadOverlay()
860 mOverlayReader->Update();
861 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
862 mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
863 mSlicers[i]->Render();
866 //----------------------------------------------------------------------------
869 //----------------------------------------------------------------------------
870 void vvSlicerManager::ReloadVF()
872 mVectorReader->Update(vvImageReader::VECTORFIELD); //deletes the old images through the VF::Init() function
873 mVF=mVectorReader->GetOutput();
874 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
875 mSlicers[i]->SetVF(mVF);
876 mSlicers[i]->Render();
879 //----------------------------------------------------------------------------
882 //----------------------------------------------------------------------------
883 void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_index)
885 if (actor_type =="overlay")
886 mOverlayReader = NULL;
888 if (actor_type =="fusion")
889 mFusionReader = NULL;
891 for (unsigned int i = 0; i < mSlicers.size(); i++)
892 mSlicers[i]->RemoveActor(actor_type,overlay_index);
894 if (actor_type=="vector") {
899 //----------------------------------------------------------------------------
902 //----------------------------------------------------------------------------
903 void vvSlicerManager::RemoveActors()
905 ///This method leaks a few objects. See RemoveActor for what a
906 ///correct implementation would look like
907 //DS -> probably due to the reader (now released in the
908 //RemoveActor() function. (I hope)
909 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
910 mSlicers[i]->SetDisplayMode(0);
911 mSlicers[i]->GetRenderer()->RemoveActor(mSlicers[i]->GetImageActor());
914 //----------------------------------------------------------------------------
917 //----------------------------------------------------------------------------
918 void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer)
920 // int view = mSlicers[slicer]->GetSliceOrientation();
921 // int slice = mSlicers[slicer]->GetSlice();
922 double x = mSlicers[slicer]->GetCursorPosition()[0];
923 double y = mSlicers[slicer]->GetCursorPosition()[1];
924 double z = mSlicers[slicer]->GetCursorPosition()[2];
925 double X = (x - mSlicers[slicer]->GetInput()->GetOrigin()[0])/
926 mSlicers[slicer]->GetInput()->GetSpacing()[0];
927 double Y = (y - mSlicers[slicer]->GetInput()->GetOrigin()[1])/
928 mSlicers[slicer]->GetInput()->GetSpacing()[1];
929 double Z = (z - mSlicers[slicer]->GetInput()->GetOrigin()[2])/
930 mSlicers[slicer]->GetInput()->GetSpacing()[2];
931 double value = -VTK_DOUBLE_MAX;
933 double xVec=0, yVec=0, zVec=0, valueVec=0;
936 double valueOver=0, valueFus=0;
937 if (X >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&
938 X <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&
939 Y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&
940 Y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&
941 Z >= mSlicers[slicer]->GetInput()->GetWholeExtent()[4] &&
942 Z <= mSlicers[slicer]->GetInput()->GetWholeExtent()[5]) {
943 value = this->GetScalarComponentAsDouble(mSlicers[slicer]->GetInput(), X, Y, Z);
945 if (mSlicers[slicer]->GetVFActor() ) {
947 unsigned int currentTime = mSlicers[slicer]->GetTSlice();
948 vtkImageData *vf = NULL;
950 if (mSlicers[slicer]->GetVF()->GetVTKImages().size() > currentTime)
951 vf = mSlicers[slicer]->GetVF()->GetVTKImages()[currentTime];
953 vf = mSlicers[slicer]->GetVF()->GetVTKImages()[0];
956 double Xvf = (x - vf->GetOrigin()[0])/ vf->GetSpacing()[0];
957 double Yvf = (y - vf->GetOrigin()[1])/ vf->GetSpacing()[1];
958 double Zvf = (z - vf->GetOrigin()[2])/ vf->GetSpacing()[2];
959 xVec = this->GetScalarComponentAsDouble( vf, Xvf, Yvf, Zvf, 0);
960 yVec = this->GetScalarComponentAsDouble( vf, Xvf, Yvf, Zvf, 1);
961 zVec = this->GetScalarComponentAsDouble( vf, Xvf, Yvf, Zvf, 2);
962 valueVec = sqrt(xVec*xVec + yVec*yVec + zVec*zVec);
965 if (mSlicers[slicer]->GetOverlayActor() ) {
967 vtkImageData *overlay = dynamic_cast<vtkImageData*>(mSlicers[slicer]->GetOverlayMapper()->GetInput());
968 double Xover = (x - overlay->GetOrigin()[0]) / overlay->GetSpacing()[0];
969 double Yover = (y - overlay->GetOrigin()[1]) / overlay->GetSpacing()[1];
970 double Zover = (z - overlay->GetOrigin()[2]) / overlay->GetSpacing()[2];
971 valueOver = this->GetScalarComponentAsDouble(overlay, Xover, Yover, Zover);
973 if (mSlicers[slicer]->GetFusionActor() ) {
975 vtkImageData *fusion = dynamic_cast<vtkImageData*>(mSlicers[slicer]->GetFusionMapper()->GetInput());
976 double Xover = (x - fusion->GetOrigin()[0]) / fusion->GetSpacing()[0];
977 double Yover = (y - fusion->GetOrigin()[1]) / fusion->GetSpacing()[1];
978 double Zover = (z - fusion->GetOrigin()[2]) / fusion->GetSpacing()[2];
979 valueFus = this->GetScalarComponentAsDouble(fusion, Xover, Yover, Zover);
981 emit UpdatePosition(mSlicers[slicer]->GetCursorVisibility(),
983 emit UpdateVector(displayVec,xVec, yVec, zVec, valueVec);
984 emit UpdateOverlay(displayOver,valueOver,value);
985 emit UpdateFusion(displayFus,valueFus);
988 //----------------------------------------------------------------------------
991 //----------------------------------------------------------------------------
992 void vvSlicerManager::Activated()
994 emit currentImageChanged(mId);
996 //----------------------------------------------------------------------------
999 //----------------------------------------------------------------------------
1000 void vvSlicerManager::Picked()
1002 emit currentPickedImageChanged(mId);
1004 //----------------------------------------------------------------------------
1007 //----------------------------------------------------------------------------
1008 void vvSlicerManager::UpdateWindowLevel()
1010 emit WindowLevelChanged();
1012 //----------------------------------------------------------------------------
1015 //----------------------------------------------------------------------------
1016 void vvSlicerManager::UpdateSlice(int slicer)
1018 if (mPreviousSlice[slicer] == mSlicers[slicer]->GetSlice()) {
1019 //DD("============= NOTHING");
1022 //std::cout << "vvSlicerManager::UpdateSlice " << slicer << " " << mSlicers[slicer]->GetSlice() << std::endl;
1023 emit UpdateSlice(slicer, mSlicers[slicer]->GetSlice());
1024 mSlicers[slicer]->Render(); // DS <-- I add this, this could/must be the only Render ...
1025 mPreviousSlice[slicer] = mSlicers[slicer]->GetSlice();
1027 //----------------------------------------------------------------------------
1030 //----------------------------------------------------------------------------
1031 void vvSlicerManager::UpdateTSlice(int slicer)
1033 int slice = mSlicers[slicer]->GetSlice();
1034 int tslice = mSlicers[slicer]->GetTSlice();
1035 if (mPreviousSlice[slicer] == slice) {
1036 if (mPreviousTSlice[slicer] == tslice) {
1037 // DD("************** NOTHING ***********");
1041 mPreviousSlice[slicer] = slice;
1042 mPreviousTSlice[slicer] = tslice;
1043 //std::cout << "vvSlicerManager::UpdateTSlice " << slicer << " " << tslice << std::endl;
1044 emit UpdateTSlice(slicer, tslice);
1046 //----------------------------------------------------------------------------
1049 //----------------------------------------------------------------------------
1050 void vvSlicerManager::UpdateSliceRange(int slicer)
1052 emit UpdateSliceRange(slicer,
1053 mSlicers[slicer]->GetSliceRange()[0], mSlicers[slicer]->GetSliceRange()[1],
1054 0,mSlicers[slicer]->GetTMax());
1056 //----------------------------------------------------------------------------
1059 //----------------------------------------------------------------------------
1060 void vvSlicerManager::SetPreset(int preset)
1062 //vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());
1063 double window = mSlicers[0]->GetColorWindow();
1064 double level = mSlicers[0]->GetColorLevel();
1066 std::string component_type=mImage->GetScalarTypeAsITKString();
1070 mImage->GetScalarRange(range);
1071 window = range[1] - range[0];
1072 level = (range[1] + range[0])* 0.5;
1102 this->SetColorWindow(window);
1103 this->SetColorLevel(level);
1110 //----------------------------------------------------------------------------
1113 //----------------------------------------------------------------------------
1114 void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlKey)
1117 int t = this->mSlicers[slicer]->GetTSlice();
1118 if(bCtrlKey && this->mSlicers[slicer]->GetFusion()) {
1119 this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max, this->mSlicers[slicer]->GetFusion()->GetVTKImages()[t]);
1120 this->SetFusionWindow(max-min);
1121 this->SetFusionLevel(0.5*(min+max));
1122 this->SetColorMap(mColorMap);
1124 else if(bCtrlKey && this->mSlicers[slicer]->GetOverlay()) {
1125 this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max, this->mSlicers[slicer]->GetOverlay()->GetVTKImages()[t]);
1126 if(this->mSlicers[slicer]->GetLinkOverlayWindowLevel()){
1127 this->SetColorWindow(max-min);
1128 this->SetColorLevel(0.5*(min+max));
1130 this->SetOverlayColorWindow(max-min);
1131 this->SetOverlayColorLevel(0.5*(min+max));
1135 this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max, this->mSlicers[slicer]->GetInput());
1136 this->SetColorWindow(max-min);
1137 this->SetColorLevel(0.5*(min+max));
1141 this->UpdateWindowLevel();
1143 //----------------------------------------------------------------------------
1146 //----------------------------------------------------------------------------
1147 void vvSlicerManager::SetColorMap(int colormap)
1150 range[0] = mSlicers[0]->GetInput()->GetScalarRange()[0];
1151 range[1] = mSlicers[0]->GetInput()->GetScalarRange()[1];
1153 double window = mSlicers[0]->GetWindowLevel()->GetWindow();
1154 double level = mSlicers[0]->GetWindowLevel()->GetLevel();
1156 vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());
1165 LUT = vtkLookupTable::New();
1166 LUT->SetValueRange(0,1);
1167 LUT->SetSaturationRange(1,1);
1168 LUT->SetHueRange(0,0.18);
1172 LUT = vtkLookupTable::New();
1173 LUT->SetValueRange(0,1);
1174 LUT->SetSaturationRange(1,1);
1175 LUT->SetHueRange(0.4,0.80);
1179 LUT = vtkLookupTable::New();
1180 LUT->SetValueRange(0.5,1);
1181 LUT->SetSaturationRange(1,1);
1182 LUT->SetHueRange(0.666,0);
1186 LUT = vtkLookupTable::New();
1187 LUT->SetValueRange(1,1);
1188 LUT->SetSaturationRange(1,1);
1189 LUT->SetHueRange(0,1);
1190 LUT->SetAlphaRange(1, 1);
1194 LUT = vtkLookupTable::New();
1195 LUT->SetValueRange(1,1);
1196 LUT->SetSaturationRange(1,1);
1197 LUT->SetHueRange(1,0.1);
1198 //LUT->SetRampToLinear();
1202 LUT->SetTableRange(level-fabs(window)/2,level+fabs(window)/2);
1205 vtkWindowLevelLookupTable* fusLUT = NULL;
1206 if (mSlicers[0]->GetFusion()) { // && mFusionColorMap >= 0) {
1207 fusLUT = vtkWindowLevelLookupTable::New();
1208 double fusRange [2];
1209 fusRange[0] = mFusionLevel - mFusionWindow/2;
1210 fusRange[1] = mFusionLevel + mFusionWindow/2;
1211 double* frange = mFusionReader->GetOutput()->GetVTKImages()[0]->GetScalarRange();
1212 fusLUT->SetTableRange(frange);
1213 fusLUT->SetValueRange(1,1);
1214 fusLUT->SetSaturationRange(1,1);
1215 fusLUT->SetAlphaRange(1, 1);
1216 fusLUT->SetWindow(mFusionWindow);
1217 fusLUT->SetLevel(mFusionLevel);
1218 if (mFusionColorMap == 1)
1219 fusLUT->SetHueRange(0,0.18);
1220 else if (mFusionColorMap == 2)
1221 fusLUT->SetHueRange(0.4,0.80);
1222 else if (mFusionColorMap == 3)
1224 fusLUT->SetHueRange(0.666, 0);
1225 fusLUT->SetValueRange(0.5, 1);
1227 else if (mFusionColorMap == 4)
1228 fusLUT->SetHueRange(0,1);
1229 else if (mFusionColorMap <= 0)
1231 fusLUT->SetValueRange(0,1);
1232 fusLUT->SetSaturationRange(0,0);
1235 fusLUT->ForceBuild();
1238 // set color table transparency
1239 double range_end = frange[0] + (double)mFusionThresOpacity*(frange[1] - frange[0])/100;
1240 double curr_value = frange[0];
1241 int nvalues = fusLUT->GetNumberOfTableValues();
1242 //for (double i = frange[0]; i <= alpha_range_end; i++) {
1243 for (double i = 0; curr_value < range_end; i++) {
1244 fusLUT->GetTableValue(i, v);
1246 fusLUT->SetTableValue(i, v);
1247 curr_value += (frange[1] - frange[0])/nvalues;
1250 for ( unsigned int i = 0; i < mSlicers.size(); i++) {
1252 if (mSlicers[i]->GetOverlay()) {
1253 vtkLookupTable* supLUT = vtkLookupTable::New();
1254 supLUT->SetTableRange(range[0],range[1]);
1255 supLUT->SetValueRange(1,1);
1256 supLUT->SetSaturationRange(1,1);
1257 supLUT->SetHueRange(double(mOverlayColor)/360,double(mOverlayColor)/360);
1259 vtkLookupTable* invLUT = vtkLookupTable::New();
1260 invLUT->SetTableRange(range[0],range[1]);
1261 invLUT->SetValueRange(1,1);
1262 invLUT->SetSaturationRange(1,1);
1263 invLUT->SetHueRange(double((mOverlayColor+180)%360)/360,double((mOverlayColor+180)%360)/360);
1265 dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
1266 ->SetWindowLevelMode(true);
1267 mSlicers[i]->GetWindowLevel()->SetLookupTable(supLUT);
1268 mSlicers[i]->GetOverlayMapper()->SetLookupTable(invLUT);
1271 } else if (mSlicers[i]->GetOverlay()) {
1272 //dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
1273 //->SetWindowLevelMode(false);
1274 mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
1276 mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
1279 if (mSlicers[i]->GetFusion()) {
1280 mSlicers[i]->GetFusionMapper()->SetLookupTable(fusLUT);
1281 mSlicers[i]->GetFusionActor()->SetOpacity(double(mFusionOpacity)/100);
1287 mColorMap = colormap;
1289 //----------------------------------------------------------------------------
1292 //----------------------------------------------------------------------------
1293 vvLandmarks* vvSlicerManager::GetLandmarks()
1295 if (mLandmarks == NULL) {
1296 mLandmarks = new vvLandmarks(mSlicers[0]->GetTMax()+1);
1297 for (unsigned int i = 0; i < mSlicers.size(); i++)
1298 mSlicers[i]->SetLandmarks(mLandmarks);
1302 //----------------------------------------------------------------------------
1305 //----------------------------------------------------------------------------
1306 void vvSlicerManager::AddLandmark(float x,float y,float z,float t)
1308 double x_index = (x - mSlicers[0]->GetInput()->GetOrigin()[0])/mSlicers[0]->GetInput()->GetSpacing()[0];
1309 double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1];
1310 double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2];
1311 if (x_index >= mSlicers[0]->GetInput()->GetWholeExtent()[0] &&
1312 x_index <= mSlicers[0]->GetInput()->GetWholeExtent()[1] &&
1313 y_index >= mSlicers[0]->GetInput()->GetWholeExtent()[2] &&
1314 y_index <= mSlicers[0]->GetInput()->GetWholeExtent()[3] &&
1315 z_index >= mSlicers[0]->GetInput()->GetWholeExtent()[4] &&
1316 z_index <= mSlicers[0]->GetInput()->GetWholeExtent()[5]) {
1317 double value = this->GetScalarComponentAsDouble(mSlicers[0]->GetInput(), x_index, y_index, z_index);
1318 this->GetLandmarks()->AddLandmark(x,y,z,t,value);
1319 emit LandmarkAdded();
1322 //----------------------------------------------------------------------------
1324 //----------------------------------------------------------------------------
1325 void vvSlicerManager::PrevImage(int slicer)
1327 emit ChangeImageWithIndexOffset(this, slicer, -1);
1329 //----------------------------------------------------------------------------
1331 //----------------------------------------------------------------------------
1332 void vvSlicerManager::NextImage(int slicer)
1334 emit ChangeImageWithIndexOffset(this, slicer, 1);
1336 //----------------------------------------------------------------------------
1338 //----------------------------------------------------------------------------
1339 void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice)
1341 emit AVerticalSliderHasChanged(slicer, slice);
1344 //----------------------------------------------------------------------------
1346 //----------------------------------------------------------------------------
1347 double vvSlicerManager::GetScalarComponentAsDouble(vtkImageData *image, double X, double Y, double Z, int component)
1350 return mSlicers[0]->GetScalarComponentAsDouble(image, X, Y, Z, ix, iy, iz, component);
1352 //----------------------------------------------------------------------------