X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=src2%2FcreaImageIOGimmickView.cpp;h=945b091ce3552ddc80bb3d4d3dc945926d7bd163;hb=e88bcb692a9d4bcc2ce1618a27d4fcb275a32a70;hp=c24a7c3c3534638640762fc75d1eaaf1e61b3e0f;hpb=6cab96fd8ca99341053a1a6f8a9286940c535313;p=creaImageIO.git diff --git a/src2/creaImageIOGimmickView.cpp b/src2/creaImageIOGimmickView.cpp index c24a7c3..945b091 100644 --- a/src2/creaImageIOGimmickView.cpp +++ b/src2/creaImageIOGimmickView.cpp @@ -112,6 +112,15 @@ namespace creaImageIO this->CreateTreeView(i->second); } } + + /// Create a tree view with a given name + void GimmickView::CreateSingleTreeView(std::string &i_name) + { + this->CreateTreeView(mGimmick->GetTreeHandlerMap()[i_name]); + + } + + //====================================================================== //====================================================================== @@ -162,7 +171,10 @@ namespace creaImageIO { ImageExtent * extent= (ImageExtent*)&ie; mExtent[2]+=(*extent).Get(2); + if(mExtent[2]>1) + { SetDimension(3); + } } //====================================================================== @@ -247,16 +259,21 @@ namespace creaImageIO } - mValidationSignal(valid); + modifyValidationSignal(valid); SetMessage(mMessage); return valid; } -//====================================================================== + //====================================================================== + void GimmickView::modifyValidationSignal(bool ivalid) + { + mValidationSignal(ivalid); + } + //====================================================================== ///Reads Images (Non Threaded) - void GimmickView::ReadImagesNotThreaded(std::vector& s,std::vector im, int dimension) + void GimmickView::ReadImagesNotThreaded(std::vector& s,std::vector im, int dimension) { // Create the output data @@ -265,16 +282,16 @@ namespace creaImageIO // Only one image : give it vtkImageData* out = vtkImageData::New(); - GimmickMessage(1, "State Check: Full Filename: " - <GetAttribute("FullFileName") + GimmickDebugMessage(3, "State Check: Full Filename: " + <ShallowCopy(mReader.GetImage(im.front()->GetAttribute("FullFileName"))); + out->ShallowCopy(mReader.GetImage(im.front())); s.push_back( out ); } else if (im.size()>1) { - vtkImageData* first = mReader.GetImage( im.front()->GetAttribute("FullFileName")); + vtkImageData* first = mReader.GetImage( im.front()); if (dimension==2) { // n2D to 3D @@ -300,11 +317,11 @@ namespace creaImageIO *dim[1]; int slice = 0; - std::vector::iterator it; - for (it=im.begin(); it!=im.end(); ++it) + std::vector::iterator it; + for (it=im.begin(); it!=im.end(); ++it) { //std::cout << "copying slice "<GetAttribute("FullFileName")); + vtkImageData* cur = mReader.GetImage( (*it)); void* src = cur->GetScalarPointer(0,0,0); void* dst = out->GetScalarPointer(0,0,slice); @@ -320,11 +337,11 @@ namespace creaImageIO else { // n3D - std::vector::iterator it; + std::vector::iterator it; for (it=im.begin(); it!=im.end(); ++it) { vtkImageData* out = vtkImageData::New(); - out->ShallowCopy(mReader.GetImage((*it)->GetAttribute("FullFileName"))); + out->ShallowCopy(mReader.GetImage(*it)); s.push_back(out); } }