lib/metamri/nifti_builder.rb in metamri-0.1.17 vs lib/metamri/nifti_builder.rb in metamri-0.1.18

- old
+ new

@@ -16,21 +16,21 @@ elsif input_options.has_key?(:input_directory) input_files = "#{input_options[:input_directory]}/'#{glob}'" else input_files = "#{Dir.tmpdir}/'#{glob}'" end - if @raw_image_files.first.rep_time && @raw_image_files.first.bold_reps && @raw_image_files.first.num_slices + if @raw_image_files.first.rep_time && @raw_image_files.first.bold_reps && @raw_image_files.first.num_slices && !input_options[:no_timing_options] slice_order = "altplus" functional_args = "-time:zt #{@raw_image_files.first.num_slices} #{@raw_image_files.first.bold_reps} #{@raw_image_files.first.rep_time} #{slice_order}" end nifti_output_file = File.join(nifti_output_directory, nifti_filename) File.makedirs(nifti_output_directory) unless File.directory?(nifti_output_directory) raise(IOError, "Cannot write to #{nifti_output_directory}") unless File.writable?(nifti_output_directory) - nifti_conversion_command = "to3d -session #{nifti_output_directory} -prefix #{nifti_filename} #{functional_args} #{input_files}" + nifti_conversion_command = "to3d -session #{nifti_output_directory} -prefix #{[nifti_filename, functional_args, input_files].compact.join(' ')}" return nifti_conversion_command, nifti_output_file end end \ No newline at end of file