Class: DefaultRecon::DicomRawSequence

Inherits:
RawSequence show all
Defined in:
lib/default_methods/recon/raw_sequence.rb

Overview

Manage a folder of Raw Dicoms for Nifti file conversion

Instance Method Summary collapse

Methods inherited from RawSequence

#initialize, #strip_leading_volumes

Constructor Details

This class inherits a constructor from DefaultRecon::RawSequence

Instance Method Details

#prepare_and_convert_sequence(outfile) ⇒ Object Also known as: prepare

Locally copy and unzip a folder of Raw Dicoms and call convert_sequence on them



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/default_methods/recon/raw_sequence.rb', line 30

def prepare_and_convert_sequence(outfile)
  @scandir = File.join(@rawdir, @scan_spec['dir'])
  $Log.info "Dicom Reconstruction: #{@scandir}"
  
  File.delete('tmp.nii') if File.exist? 'tmp.nii'
  
  Pathname.new(@scandir).all_dicoms do |dicoms|
    convert_sequence(dicoms, 'tmp.nii')
  end
  
  strip_leading_volumes('tmp.nii', outfile, @volumes_to_skip, @scan_spec['bold_reps'])
end