Class: DefaultRecon::RawSequence
- Inherits:
-
Object
- Object
- DefaultRecon::RawSequence
- 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
Instance Method Summary collapse
-
#initialize(scan_spec, rawdir, volumes_to_skip) ⇒ RawSequence
constructor
A new instance of RawSequence.
-
#strip_leading_volumes(infile, outfile, volume_skip, bold_reps) ⇒ Object
In most cases this will be 3 volumes.
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" = [infile, outfile, volume_skip.to_s, bold_reps.to_s] cmd = cmd_fmt % unless run(cmd) raise ScriptError, "Failed to strip volumes: #{cmd}" end end |