Class: DefaultRecon::RawSequence

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

Overview

An abstract class for Raw Image Sequences The Recon job will calls prepare on Raw Sequence Instances to process them from their raw state (dicoms or pfiles) to Nifti files suitable for processing.

Direct Known Subclasses

DicomRawSequence, PfileRawSequence

Instance Method Summary collapse

Constructor Details

#initialize(scan_spec, rawdir, volumes_to_skip) ⇒ RawSequence

Returns a new instance of RawSequence.



7
8
9
10
11
# File 'lib/default_methods/recon/raw_sequence.rb', line 7

def initialize(scan_spec, rawdir, volumes_to_skip)
  @scan_spec = scan_spec
  @rawdir = rawdir
  @volumes_to_skip = volumes_to_skip
end

Instance Method Details

#strip_leading_volumes(infile, outfile, volume_skip, bold_reps) ⇒ Object

In most cases this will be 3 volumes. Writes result in current working directory.



15
16
17
18
19
20
21
22
23
# File 'lib/default_methods/recon/raw_sequence.rb', line 15

def strip_leading_volumes(infile, outfile, volume_skip, bold_reps)
	$Log.info "Stripping #{volume_skip.to_s} leading volumes: #{infile}"
	cmd_fmt = "fslroi %s %s %s %s"
	cmd_options = [infile, outfile, volume_skip.to_s, bold_reps.to_s]
	cmd = cmd_fmt % cmd_options
	unless run(cmd)
	  raise ScriptError, "Failed to strip volumes: #{cmd}"
  end
end