help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dicom support


From: Judd Storrs
Subject: Re: dicom support
Date: Sun, 2 May 2010 21:04:55 -0400

I've been playing with gdcm and I can't figure out how to supersede or
replace the builtin compile-time dictionaries to use keywords instead
of names. Maybe the best approach is to keep a separate table of keys
and names used by the octave interface? Maybe something along these
lines:


#include "gdcmGlobal.h"
#include "gdcmDict.h"

#include <string>
#include <map>

static std::map<gdcm::Tag, std::string> tagdict ;
static std::map<std::string, gdcm::Tag> keydict ;

void
set_keyword (gdcm::Tag tag, std::string keyword)
{
  keydict[keyword] = tag ;
  tagdict[tag] = keyword ;
}

int main( int argc, char* argv[] )
{
  // Actually populate by reading a file
  set_keyword ( gdcm::Tag(0x0010, 0x0010), "PatientName" );


  gdcm::Tag t = gdcm::Tag(0x0010, 0x0010) ;
  std::string k = "PatientName" ;

  std::cout << t << " -> " << tagdict[t] << std::endl ;
  std::cout << k << " -> " << keydict[k] << std::endl ;

  return 0;
}


--judd


reply via email to

[Prev in Thread] Current Thread [Next in Thread]