help-octave
[Top][All Lists]
Advanced

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

Re: dicom support


From: Andy Buckle
Subject: Re: dicom support
Date: Mon, 3 May 2010 09:15:57 +0100

I think GDCM uses XML. eg, they are mostly (?all) here:

https://gdcm.svn.sourceforge.net/svnroot/gdcm/branches/gdcm-2-0/Source/DataDictionary/

(I am using the latest stable branch, currently version 2.0.14)

I wanted to avoid having to parse dictionary files. Though, as we will
need to do the lookup both ways, and don't want spaces and apostrophes
in the names, we may have to. GDCM seems to use something more complex
than just a single file for its dictionary.

If we do end up having to create out own dictionary files, my first
thought was to take GDCM's and use sed to change the names for out
purposes.

This is from the gdcmConfigure.h that is generated by cmake

/* Hard code the path to the public dictionary */
#define PUB_DICT_PATH ""

Could probably edit that, or set extra flags when running cmake. I
think GDCM also does stuff with private tags, somewhere.

Andy

On Mon, May 3, 2010 at 2:04 AM, Judd Storrs <address@hidden> wrote:
> 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
>



-- 
/* andy buckle */



reply via email to

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