X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicerManager.cxx;h=46e7764228b8a2b659171fef71c158535e2bb96c;hb=1520bb5daceae6c3a6ec221c60a462a02d5c08ab;hp=c23c1207ba891e4848751ebdac85efa26a228c27;hpb=66c0b229be48fdbbe2d42bcb5fa461ab87461ae3;p=clitk.git diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index c23c120..46e7764 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -146,7 +146,7 @@ void vvSlicerManager::ToggleContourSuperposition() //---------------------------------------------------------------------------- -bool vvSlicerManager::SetImage(std::string filename, LoadedImageType type, int n) +bool vvSlicerManager::SetImage(std::string filename, LoadedImageType type, int n, unsigned int slice) { mType = type; if (mReader == NULL) @@ -154,6 +154,7 @@ bool vvSlicerManager::SetImage(std::string filename, LoadedImageType type, int n std::vector filenames; filenames.push_back(filename); mReader->SetInputFilenames(filenames); + mReader->SetSlice(slice); // Only used for SLICED type mReader->Update(type); SetFilename(filename, n); @@ -342,35 +343,6 @@ bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename) //---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -void vvSlicerManager::SetExtractedImage(std::string filename,vvImage::Pointer image, int slice) -{ - mFileName = filename; - mImage = vvImage::New(); - if (image->GetNumberOfDimensions() == 4) { - mImage->AddImage(image->GetVTKImages()[slice]); - for ( unsigned int i = 0; i < mSlicers.size(); i++) { - mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename)); - mSlicers[i]->SetImage(mImage); - } - } else { - vtkImageClip* clipper = vtkImageClip::New(); - int extent[6]; - image->GetVTKImages()[0]->GetWholeExtent(extent); - clipper->SetInput(image->GetVTKImages()[0]); - clipper->SetOutputWholeExtent(extent[0],extent[1],extent[2],extent[3],slice,slice); - clipper->Update(); - mImage->AddImage(clipper->GetOutput()); - for ( unsigned int i = 0; i < mSlicers.size(); i++) { - mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename)); - mSlicers[i]->SetImage(mImage); - } - clipper->Delete(); - } -} -//---------------------------------------------------------------------------- - - //---------------------------------------------------------------------------- vvSlicer* vvSlicerManager::GetSlicer(int i) {