Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Groovy is a very elegant way of scripting dcm4che2:

import org.dcm4che2.data.*
import org.dcm4che2.io.*

// open stream and ensure that it is closed properly
new DicomInputStream(/d:\foo.dcm/ as File).withStream {dicomInputSteam ->
    // read the object from input stream
    def dicomObject = dicomInputSteam.readDicomObject()
    
    // iterate through all elements and print the element
    dicomObject.each {dicomElement ->
        println dicomElement
    }
}
  • No labels