lib/metamri/raw_image_file.rb in metamri-0.2.3 vs lib/metamri/raw_image_file.rb in metamri-0.2.4
- old
+ new
@@ -141,11 +141,15 @@
# Predicate simply returns true if "dicom" is stored in the img_type instance variable.
def dicom?
return @file_type == "dicom"
end
+ def geifile?
+ return @file_type == "geifile"
+ end
+
# Returns a yaml string based on a subset of the attributes. Specifically,
# the @hdr_data is not included. This is used to generate .yaml files that are
# placed in image directories for later scanning by YamlScanner.
def to_yaml
yamlhash = {}
@@ -292,11 +296,12 @@
# Returns a string that indicates the file type. This is difficult because dicom
# files have no consistent naming conventions/suffixes. Here we chose to call a
# file a "pfile" if it is an image and the file name is of the form P*.7
# All other images are called "dicom".
def determine_file_type
- return "pfile" if image? and (@filename =~ /^P.....\.7/) != nil
- return "dicom" if image? and (@filename =~ /^P.....\.7/) == nil
+ return "pfile" if image? and (@filename =~ /^P.....\.7/) != nil
+ return "geifile" if image? and (@filename =~ /^I\.\d*/) != nil
+ return "dicom" if image? and (@filename =~ /^P.....\.7/) == nil
return nil
end
# Parses the header data and extracts a collection of instance variables. If
\ No newline at end of file