0
votes

I have an application on hands sitting on top of VTK 5.3. Using vtkDICOMImageReader I'm getting image position, width, height, ..., so far so good.

But is there a good way to read ImageType string with tag (0008,0008)?

More general, could I read any tag back using vtkDICOMImageReader? Pass tag value, get back what's in the DICOM file?

1
I think that you need an ITK image reader. Here's an example; itk.org/Doxygen/html/…john elemans

1 Answers

1
votes
#include "gdcmReader.h"
#include "gdcmMediaStorage.h"

int main(int argc, char *argv [])
{
  if( argc < 2 ) return 1;
  const char *filename = argv[1];

  gdcm::Reader reader;
  reader.SetFileName( filename);
  if( !reader.Read() )
    {
    std::cerr << "Could not read: " << filename << std::endl;
    return 1;
    }
  std::stringstream strm;

  gdcm::File &file = reader.GetFile();
  gdcm::DataSet &ds = file.GetDataSet();
  gdcm::FileMetaInformation &fmi = file.GetHeader();

  ConstIterator it = ds.GetDES().begin();

  for( ; it != ds.GetDES().end(); ++it){
      if (it->GetTag()==gdcm::Tag (0x0008, 0x0008)){
      std:cout << it;
  }