Class: DicomStudyFactory::Transformer

Inherits:
Object
  • Object
show all
Defined in:
lib/dicom_study_factory/transformer.rb

Overview

Transforme gets all the .dcm files in one directory and apply a factory data to populate the dicom with tags

Constant Summary collapse

SOURCE_DIR =
'tmp/source'
OUTPUT_DIR =
'tmp/output'

Instance Method Summary collapse

Constructor Details

#initializeTransformer

Returns a new instance of Transformer.



11
12
13
14
# File 'lib/dicom_study_factory/transformer.rb', line 11

def initialize
  FileUtils.mkdir_p(SOURCE_DIR) unless Dir.exist? SOURCE_DIR
  FileUtils.mkdir_p(OUTPUT_DIR) unless Dir.exist? OUTPUT_DIR
end

Instance Method Details

#filesObject



16
17
18
# File 'lib/dicom_study_factory/transformer.rb', line 16

def files
  Dir.glob(File.join(SOURCE_DIR, '**/*.dcm'))
end

#output_filesObject



20
21
22
# File 'lib/dicom_study_factory/transformer.rb', line 20

def output_files
  Dir.glob(File.join(OUTPUT_DIR, '**/*.dcm'))
end