Created
June 17, 2009 10:56
-
-
Save sween/131185 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dcm4che2 Toolkit with the elegance of Ruby | |
# Read File Example - Ron Sweeney | |
require 'java' | |
include_class 'java.io.BufferedInputStream' | |
include_class 'java.io.FileInputStream' | |
include_class 'org.dcm4che2.io.DicomInputStream' | |
include_class 'org.dcm4che2.data.BasicDicomObject' | |
def PrintTag(tagvalue) | |
dcm = BasicDicomObject.new | |
din = DicomInputStream.new(BufferedInputStream.new(FileInputStream.new("c:\\MR.dcm"))) | |
din.readDicomObject(dcm, -1) | |
dicomvalue = dcm.getString(tagvalue) | |
return dicomvalue | |
end | |
puts "Patient Name: " + PrintTag(0x00100010) | |
puts "Modality Type: " + PrintTag(0x00080060) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment