IRSplitString(ext," ",v);
}
-
+
void ReadDicomInfo(const std::string& filename,
DicomNode* image)
{
+ // std::cout << "SpecificVtkReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
boost::filesystem::path full_path(filename);
std::string f = full_path.leaf();
//Utilities::GetFileName(filename));
image->SetFieldValue("A0004_1500",irclean(f));
// Does not work :
// How to get the image info without loading it in vtk ?
- /*
+
mVTKReader->SetFileName(filename.c_str());
- mVTKReader->OpenFile();
+ mVTKReader->Update(); //OpenFile();
int ext[6];
mVTKReader->GetDataExtent(ext);
// Columns
char str[128];
sprintf(str,"%i",ext[1]-ext[0]);
+ // std::cout << "col="<<str<<std::endl;
image->SetFieldValue("A0028_0011",str);
// Rows
sprintf(str,"%i",ext[3]-ext[2]);
+ // std::cout << "row="<<str<<std::endl;
image->SetFieldValue("A0028_0010",str);
- */
-
+ // Planes == frames
+ sprintf(str,"%i",ext[5]-ext[4]);
+ // std::cout << "frames="<<str<<std::endl;
+ image->SetFieldValue("A0028_0008",str);
+
}
private:
vtkImageReader2* mVTKReader;
void ReadDicomInfo(const std::string& filename,
DicomNode* image)
{
+ // std::cout << "DicomReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
GDCM_NAME_SPACE::File* file = GDCM_NAME_SPACE::File::New();
file->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
file->SetFileName(filename.c_str());
void ImageReader::ReadDicomInfo(const std::string& filename,
DicomNode* image)
{
+ // std::cout << "ImageReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
// std::cout << "## ImageReader::Read("<<filename<<")"<<std::endl;
if (mLastFilename!=filename)
{