Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm using GDCM on iOS. I haven't pushed it very hard yet but it's working well so far. I basically followed the directions for hacking XCode projects to run in iOS in this excellent article on <a href="http://www.insight-journal.org/browse/publication/755" rel="noreferrer">ITK</a>.</p> <p>Here's how I got it to compile for iOS:</p> <ol> <li>Downloaded source from sourceforge, installed cmake via ports. You'll need a recent version of cmake (I'm using 2.8.2)</li> <li>If the source is in a folder called gdcm-2.0.17/, then create another directory at that level (say gdcmbin), cd to that directory, and enter <strong>ccmake -GXCode ../gdcm-2.0.17/</strong> in the terminal window. This creates the XCode project. When I did this I didn't create any of the example programs or create shared libraries (which won't work in iOS). Just run the defaults.</li> <li>Follow the directions in the ITK paper on changing the build options (step #7 on page 4).</li> <li>Then link GDCM into your project using the excellent instructions at <a href="http://www.clintharris.net/2009/iphone-app-shared-libraries/" rel="noreferrer">Clint Harris' blog</a></li> <li>When you're setting up the header search path in your project to GDCM - you have to enter two paths: <em>blah</em>/gdcm-2.0.17/Source/** and <em>blah</em>/gdcmbin/**. The trailing '/Source' on the first path is necessary - otherwise you get headers that aren't appropriate for your architecture.</li> <li>One glitch (annoying but haven't spent the time to figure it out yet): you get a bunch of linking errors when you switch from simulator to device (or vice versa). This is because the gdcm project doesn't put the outputs into different directories for different targets. So - run a clean and rebuild in the gdcm project when you're switching. I'll probably get annoyed by this soon enough to change it :-).</li> </ol> <p>Here's a rough snippet of how you'd call the library and put the results in an Objective-C dictionary:</p> <pre><code>NSMutableDictionary * imageDictionary = [[NSMutableDictionary alloc] initWithCapacity:40]; // The output of gdcm::Reader is a gdcm::File gdcm::File &amp;file = reader.GetFile(); // the dataset is the the set of element we are interested in: gdcm::DataSet &amp;ds = file.GetDataSet(); const Tag studyInstance(0x0020,0x000d); // Study Instance UID const DataElement &amp;dicomVal = ds.GetDataElement(studyInstance); std::string stringVal( dicomVal.GetByteValue()-&gt;GetPointer(), dicomVal.GetByteValue()-&gt;GetLength() ); NSString *val = [NSString stringWithCString:stringVal.c_str() encoding:[NSString defaultCStringEncoding]]; [imageDictionary setObject:val forKey:@"studyInstanceUID"]; </code></pre> <p>(Note: this is in an *.mm file that mixes C++ and ObjectiveC)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload