+ } // for
+
+
+ if ((fileVector.size()>1) && (sh->IsCoherent( &fileVector )))
+ {
+ sh->OrderFileList(&fileVector);
+ spacing= sh->GetZSpacing();
+ im.clear();
+ int i;
+ for (i=0; i<fileVector.size(); i++)
+ {
+ im.push_back( (fileVector[i])->GetFileName() );
+ }
+ for (i=0; i<lstAux.size(); i++)
+ {
+ im.push_back( lstAux[i] );
+ }
+ }else {
+ std::sort( im.begin(), im.end() );
+ }
+
+ return spacing;
+}
+
+
+//======================================================================
+
+
+void GimmickView::ReadImagesNotThreadedInVector(std::vector<vtkImageData*>& s, std::vector<std::string> im, int dimension)
+{
+ // Create the output data
+ if (im.size()==1)
+ {
+ // Only one image : give it
+ vtkImageData* out = vtkImageData::New();
+ GimmickDebugMessage(3, "State Check: Full Filename: "
+ <<im.front()
+ <<std::endl);
+ out->ShallowCopy(mReader.GetImage(im.front()));
+ s.push_back( out );
+ }
+ else if (im.size()>1) // Test inutile ? JPR
+ {
+ vtkImageData* first = mReader.GetImage( im.front());
+ if (dimension == 2)
+ {
+ // n3D
+ std::vector<std::string>::iterator it;
+ for (it=im.begin(); it!=im.end(); ++it)
+ {
+ std::cout << "----------------------------------------n3D" << std::endl;
+ vtkImageData* out = vtkImageData::New();
+ out->ShallowCopy(mReader.GetImage(*it));
+ s.push_back(out);
+ }
+ }
+ else
+ {
+ // n2D to 3D // NO!
+ // n *2D + T in a vector :
+ std::cout << "---------------------------------------- n *2D + T" << std::endl;
+ std::vector<std::string>::iterator it;
+ for (it=im.begin(); it!=im.end(); ++it)
+ {
+ std::cout << "---------------------------------------- [" << *it << "]" << std::endl;
+ //vtkImageData* out = mReader.GetImage( (*it));
+ //s.push_back(out);
+ vtkImageData* out = vtkImageData::New();
+ out->ShallowCopy(mReader.GetImage(*it));
+ s.push_back(out);
+ }
+ }
+ }