+ o_output.push_back(out);
+ }
+ // If we want only one output information structure, we set it outside the loop
+ if(!i_attr.mult)
+ {
+ getAttributes(im.front(), o_output.front().infos, i_attr);
+printf("EED GimmickView::readImages1 C %s \n ", o_output.front().infos.find("D0019_100a")->second.c_str() );
+ }
+
+ }
+
+ //////////////////////////////////////////////////////////
+ // create an output structure with n entries = 1 output
+ //////////////////////////////////////////////////////////
+ void GimmickView::readImages3(std::vector<OutStrGimmick>& o_output, std::vector<std::string> im,
+ OutputAttr i_attr, double i_zspc)
+ {
+ OutStrGimmick out;
+ vtkImageData* first = mReader.GetImage( im.front());
+ out.img = vtkImageData::New();
+ out.img->SetScalarType(first->GetScalarType());
+ out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
+ int ext[6];
+ first->GetWholeExtent(ext); // send also 0,0 in Z
+ if(ext[5] == 0)
+ {
+ ext[5] = (int)im.size()-1;
+ } else {
+ ext[5] = ext[5] * (int)im.size()-1; // to deal with multiframes
+ }
+ out.img->SetExtent(ext);
+ int dim[3];
+ double spac[3];
+ first->GetDimensions(dim);
+ first->GetSpacing(spac);
+ out.img->SetSpacing(spac);
+ out.img->SetDimensions(dim[0], dim[1], (int)im.size() );
+ out.img->AllocateScalars();
+ out.img->Update();
+ unsigned long imsize = dim[0] * dim[1];
+ imsize = imsize * dim[2] ; // deal with multiframes here
+ // differents formats char , short, etc...
+ // differents components 1..3 ex. jpg ->RGB 3
+ imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();
+ // Order the file name vector already did with the OutputModel!!!
+ //!!!!out.img->SetSpacing(i_zspc);
+ int slice = 0;
+ std::vector<std::string>::iterator it;
+ for (it=im.begin(); it!=im.end(); ++it)
+ {
+ vtkImageData* cur = mReader.GetImage( (*it) );
+ memcpy(out.img->GetScalarPointer(0,0,slice), cur->GetScalarPointer(0,0,0), imsize);
+ slice++;
+ }
+ getAttributes(im.front(),out.infos, i_attr);
+ o_output.push_back(out);
+ }
+
+
+ // TO DO NO VERY SURE : NEED TO BE TESTED
+ //////////////////////////////////////////////////////////
+ // create an output structure with n entries (T size) = T output (n size)
+ //////////////////////////////////////////////////////////
+ void GimmickView::readImages2(std::vector<OutStrGimmick>& o_output, std::vector<std::string> im,
+ OutputAttr i_attr, double i_zspc)
+ {
+ vtkImageData* first = mReader.GetImage( im.front());
+ int dim[3];
+ double spac[3];
+ first->GetDimensions(dim);
+ first->GetSpacing(spac);
+ // differents formats char , short, etc...
+ // differents components 1..3 ex. jpg ->RGB 3
+ unsigned long imsize = dim[0] * dim[1];
+ imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();
+
+ // Order the file name vector already did with the OutputModel!!!
+ std::vector<std::string>::iterator it;
+ std::vector<OutStrGimmick>::iterator it_out = o_output.begin();
+
+ for (it=im.begin(); it!=im.end(); ++it)//, it_out ++)
+ {
+ vtkImageData* cur = mReader.GetImage( (*it) );
+ for (int slice= 0 ; slice <dim[2]; slice++)