public:
ImageExtent(const std::string& x, const std::string& y, const std::string& z, const std::string& t)
{
- sscanf(x.c_str(),"%d",&mExtent[0]);
- sscanf(y.c_str(),"%d",&mExtent[1]);
- sscanf(z.c_str(),"%d",&mExtent[2]);
- sscanf(t.c_str(),"%d",&mExtent[3]);
- if(x==""){mExtent[0]=1;}
- if(y==""){mExtent[1]=1;}
- if(z==""){mExtent[2]=1;}
- if(t==""){mExtent[3]=1;}
-
- if (mExtent[3]>1) mDim=4;
- else if (mExtent[2]>1) mDim=3;
- else if (mExtent[1]>1) mDim=2;
- else if (mExtent[0]>1) mDim=1;
- else mDim=0;
+ sscanf(x.c_str(),"%d",&mExtent[0]);
+ sscanf(y.c_str(),"%d",&mExtent[1]);
+ sscanf(z.c_str(),"%d",&mExtent[2]);
+ sscanf(t.c_str(),"%d",&mExtent[3]);
+ if(x==""){mExtent[0]=1;}
+ if(y==""){mExtent[1]=1;}
+ if(z==""){mExtent[2]=1;}
+ if(t==""){mExtent[3]=1;}
+
+ if (mExtent[3]>1) mDim=4;
+ else if (mExtent[2]>1) mDim=3;
+ else if (mExtent[1]>1) mDim=2;
+ else if (mExtent[0]>1) mDim=1;
+ else mDim=0;
}
}
else
{
- std::string extentx = (*sel).GetAttribute("D0028_0010");
- std::string extenty = (*sel).GetAttribute("D0028_0011");
- std::string extentz = (*sel).GetAttribute("D0028_0012");
- std::string extentt = (*sel).GetAttribute("D0028_0010");
- if( extentx == "" && extenty == "" && extentz == "")
- {
- // we try to create a vtkImageData just to get dim informations
- // Long method need to improve it!
- std::string name = (*sel).GetAttribute("FullFileName");
- if (name != "")
- {
- int dim[3];
- char c[5];
- mReader.GetImage(name)->GetDimensions(dim);
- sprintf(c,"%d", dim[0]);
- extentx = c;
- sprintf(c,"%d", dim[1]);
- extenty = c;
- sprintf(c,"%d", dim[2]);
- extentz = c;
- }
- }
+ boost::shared_ptr<ImageExtent> ie=boost::shared_ptr<ImageExtent>(new ImageExtent((*sel).GetAttribute("D0028_0010"),
+ (*sel).GetAttribute("D0028_0011"),
+ (*sel).GetAttribute("D0028_0012"),
+ ""));
- boost::shared_ptr<ImageExtent> ie=boost::shared_ptr<ImageExtent>(new ImageExtent(extentx, extenty, extentz,extentt));
if(mImageExtent==0)
{
mImageExtent=ie;
vtkImageData* first = mReader.GetImage( i_file);
int dim[3];
first->GetDimensions(dim);
- if (dim[3] > 1)
+ if (dim[2] > 1)
{
bres = false;
}
// 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);
+ getAttributes(im.front(), o_output.front().infos, i_attr);
}
}
}
- //////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////
// create an output structure with n entries (T size) = T + n output
//////////////////////////////////////////////////////////
void GimmickView::readImages4(std::vector<OutStrGimmick>& o_output, std::vector<std::string> im,
-
void GimmickView::ReadImagesNotThreadedInVector(std::vector<vtkImageData*>& s, std::vector<std::string> im, int dimension)
{
// Create the output data
// }
//}
//
-} // EO namespace creaImageIO
\ No newline at end of file
+} // EO namespace creaImageIO