metamri 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/bin/import_study.rb +1 -2
- data/bin/import_visit.rb +1 -2
- data/lib/metamri/core_additions.rb +2 -2
- data/lib/metamri/nifti_builder.rb +2 -2
- data/lib/metamri/raw_image_dataset.rb +19 -1
- data/lib/metamri/raw_image_dataset_thumbnail.rb +1 -1
- data/lib/metamri/raw_image_file.rb +25 -18
- data/lib/metamri/visit_raw_data_directory.rb +15 -2
- data/lib/metamri.rb +3 -1
- data/metamri.gemspec +5 -2
- data/test/nifti_builder_spec.rb +5 -8
- data/test/raw_image_dataset_test.rb +2 -2
- data/test/raw_image_dataset_thumbnail_spec.rb +4 -3
- data/test/raw_image_file_test.rb +7 -7
- data/test/visit_duplication_test.rb +2 -2
- data/test/visit_test.rb +1 -1
- metadata +17 -5
data/Rakefile
CHANGED
@@ -28,6 +28,8 @@ begin
|
|
28
28
|
gemspec.homepage = "http://github.com/brainmap/metamri"
|
29
29
|
gemspec.authors = ["Kristopher J. Kosmatka"]
|
30
30
|
gemspec.add_dependency('sqlite3-ruby')
|
31
|
+
gemspec.add_dependency('dicom')
|
32
|
+
# gemspec.add_dependency('rmagick')
|
31
33
|
gemspec.add_development_dependency('rspec')
|
32
34
|
end
|
33
35
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.18
|
data/bin/import_study.rb
CHANGED
data/bin/import_visit.rb
CHANGED
@@ -32,11 +32,10 @@
|
|
32
32
|
#
|
33
33
|
|
34
34
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
35
|
-
|
36
|
-
require 'visit_raw_data_directory'
|
37
35
|
require 'pathname'
|
38
36
|
require 'rdoc/usage'
|
39
37
|
require 'logger'
|
38
|
+
require 'metamri'
|
40
39
|
|
41
40
|
# == Function
|
42
41
|
# Imports imaging data collected during a single visit into the WADRC Data Tools web application database.
|
@@ -56,7 +56,7 @@ class Pathname
|
|
56
56
|
def first_dicom
|
57
57
|
entries.each do |leaf|
|
58
58
|
branch = self + leaf
|
59
|
-
if leaf.to_s =~ /^I\.|\.dcm(\.bz2)?$|\.
|
59
|
+
if leaf.to_s =~ /^I\.|\.dcm(\.bz2)?$|\.[0-9]+(\.bz2)?$/
|
60
60
|
lc = branch.local_copy
|
61
61
|
begin
|
62
62
|
yield lc
|
@@ -77,7 +77,7 @@ class Pathname
|
|
77
77
|
|
78
78
|
entries.each do |leaf|
|
79
79
|
branch = self + leaf
|
80
|
-
if leaf.to_s =~ /^I
|
80
|
+
if leaf.to_s =~ /^I\.(\.bz2)?$|\.dcm(\.bz2)?$|\.[0-9]+(\.bz2)?$/
|
81
81
|
local_copies << branch.local_copy(tempdir)
|
82
82
|
end
|
83
83
|
end
|
@@ -18,7 +18,7 @@ module UnknownImageDataset
|
|
18
18
|
else input_files = "#{Dir.tmpdir}/'#{glob}'"
|
19
19
|
end
|
20
20
|
|
21
|
-
if @raw_image_files.first.rep_time && @raw_image_files.first.bold_reps && @raw_image_files.first.num_slices
|
21
|
+
if @raw_image_files.first.rep_time && @raw_image_files.first.bold_reps && @raw_image_files.first.num_slices && !input_options[:no_timing_options]
|
22
22
|
slice_order = "altplus"
|
23
23
|
functional_args = "-time:zt #{@raw_image_files.first.num_slices} #{@raw_image_files.first.bold_reps} #{@raw_image_files.first.rep_time} #{slice_order}"
|
24
24
|
end
|
@@ -29,7 +29,7 @@ module UnknownImageDataset
|
|
29
29
|
File.makedirs(nifti_output_directory) unless File.directory?(nifti_output_directory)
|
30
30
|
raise(IOError, "Cannot write to #{nifti_output_directory}") unless File.writable?(nifti_output_directory)
|
31
31
|
|
32
|
-
nifti_conversion_command = "to3d -session #{nifti_output_directory} -prefix #{nifti_filename
|
32
|
+
nifti_conversion_command = "to3d -session #{nifti_output_directory} -prefix #{[nifti_filename, functional_args, input_files].compact.join(' ')}"
|
33
33
|
|
34
34
|
return nifti_conversion_command, nifti_output_file
|
35
35
|
end
|
@@ -21,6 +21,8 @@ class RawImageDataset
|
|
21
21
|
attr_reader :rmr_number
|
22
22
|
# From the first raw image file in the dataset
|
23
23
|
attr_reader :timestamp
|
24
|
+
# From the first raw image file in the dataset
|
25
|
+
attr_reader :study_id
|
24
26
|
# A key string unique to a dataset composed of the rmr number and the timestamp.
|
25
27
|
attr_reader :dataset_key
|
26
28
|
# the file scanned
|
@@ -51,17 +53,26 @@ class RawImageDataset
|
|
51
53
|
raise(IndexError, im.to_s + " is not a RawImageFile") if im.class.to_s != "RawImageFile"
|
52
54
|
end
|
53
55
|
@raw_image_files = raw_image_files
|
56
|
+
|
54
57
|
@series_description = @raw_image_files.first.series_description
|
55
58
|
raise(IndexError, "No series description found") if @series_description.nil?
|
59
|
+
|
56
60
|
@rmr_number = @raw_image_files.first.rmr_number
|
57
61
|
raise(IndexError, "No rmr found") if @rmr_number.nil?
|
62
|
+
|
58
63
|
@timestamp = get_earliest_timestamp
|
59
64
|
raise(IndexError, "No timestamp found") if @timestamp.nil?
|
65
|
+
|
60
66
|
@dataset_key = @rmr_number + "::" + @timestamp.to_s
|
67
|
+
|
61
68
|
@scanned_file = @raw_image_files.first.filename
|
62
69
|
raise(IndexError, "No scanned file found") if @scanned_file.nil?
|
70
|
+
|
63
71
|
@scanner_source = @raw_image_files.first.source
|
64
72
|
raise(IndexError, "No scanner source found") if @scanner_source.nil?
|
73
|
+
|
74
|
+
@study_id = @raw_image_files.first.study_id.nil? ? nil : @raw_image_files.first.study_id
|
75
|
+
# raise(IndexError, "No study id / exam number found") if @study_id.nil?
|
65
76
|
|
66
77
|
$LOG ||= Logger.new(STDOUT)
|
67
78
|
end
|
@@ -165,7 +176,14 @@ Returns a path to the created dataset as a string if successful.
|
|
165
176
|
begin
|
166
177
|
nifti_conversion_command, nifti_output_file = to_nifti(nifti_output_directory, nifti_filename, input_options)
|
167
178
|
puts nifti_conversion_command
|
168
|
-
|
179
|
+
begin
|
180
|
+
system "#{nifti_conversion_command}"
|
181
|
+
raise ScriptError, "#{nifti_output_file} does not exist." unless File.exist?(nifti_output_file)
|
182
|
+
rescue ScriptError => e
|
183
|
+
input_options[:no_timing_options] = true
|
184
|
+
nifti_conversion_command, nifti_output_file = to_nifti(nifti_output_directory, nifti_filename, input_options)
|
185
|
+
system "#{nifti_conversion_command}"
|
186
|
+
end
|
169
187
|
raise(IOError, "Could not convert image dataset: #{@directory} to #{nifti_output_file}") unless $? == 0
|
170
188
|
rescue IOError => e
|
171
189
|
$LOG.warn "-- Warning: #{e.message}"
|
@@ -36,6 +36,8 @@ class RawImageFile
|
|
36
36
|
attr_reader :source
|
37
37
|
# An identifier unique to a 'visit', these are assigned by the scanner techs at scan time.
|
38
38
|
attr_reader :rmr_number
|
39
|
+
# An identifier unique to a Study Session - AKA Exam Number
|
40
|
+
attr_reader :study_id
|
39
41
|
# A short string describing the acquisition sequence. These come from the scanner.
|
40
42
|
# code and are used to initialise SeriesDescription objects to find related attributes.
|
41
43
|
attr_reader :series_description
|
@@ -300,79 +302,84 @@ Extracts a collection of metadata from @hdr_data retrieved using the dicom_hdr
|
|
300
302
|
utility.
|
301
303
|
=end
|
302
304
|
def dicom_hdr_import
|
303
|
-
|
304
|
-
|
305
|
+
dicom_tag_templates = {}
|
306
|
+
dicom_tag_templates[:rmr_number] = {
|
305
307
|
:type => :string,
|
306
308
|
:pat => /[ID Accession Number|ID Study Description]\/\/(RMR.*)\n/i,
|
307
309
|
:required => true
|
308
310
|
}
|
309
|
-
|
311
|
+
dicom_tag_templates[:study_id] = {
|
312
|
+
:type => :string,
|
313
|
+
:pat => /STUDY ID\/\/([0-9]+)/i,
|
314
|
+
:required => true
|
315
|
+
}
|
316
|
+
dicom_tag_templates[:slice_thickness] = {
|
310
317
|
:type => :float,
|
311
318
|
:pat => /ACQ SLICE THICKNESS\/\/(.*)\n/i,
|
312
319
|
:required => false
|
313
320
|
}
|
314
|
-
|
321
|
+
dicom_tag_templates[:slice_spacing] = {
|
315
322
|
:type => :float,
|
316
323
|
:pat => /ACQ SPACING BETWEEN SLICES\/\/(.*)\n/i,
|
317
324
|
:required => false
|
318
325
|
}
|
319
|
-
|
326
|
+
dicom_tag_templates[:source] = {
|
320
327
|
:type => :string,
|
321
328
|
:pat => /ID INSTITUTION NAME\/\/(.*)\n/i,
|
322
329
|
:required => true
|
323
330
|
}
|
324
|
-
|
331
|
+
dicom_tag_templates[:series_description] = {
|
325
332
|
:type => :string,
|
326
333
|
:pat => /ID SERIES DESCRIPTION\/\/(.*)\n/i,
|
327
334
|
:required => true
|
328
335
|
}
|
329
|
-
|
336
|
+
dicom_tag_templates[:gender] = {
|
330
337
|
:type => :string,
|
331
338
|
:pat => /PAT PATIENT SEX\/\/(.)/i,
|
332
339
|
:required => false
|
333
340
|
}
|
334
|
-
|
341
|
+
dicom_tag_templates[:reconstruction_diameter] = {
|
335
342
|
:type => :int,
|
336
343
|
:pat => /ACQ RECONSTRUCTION DIAMETER\/\/([0-9]+)/i,
|
337
344
|
:required => false
|
338
345
|
}
|
339
|
-
|
346
|
+
dicom_tag_templates[:acquisition_matrix_x] = {
|
340
347
|
:type => :int,
|
341
348
|
:pat => /IMG Rows\/\/ ([0-9]+)/i,
|
342
349
|
:required => false
|
343
350
|
}
|
344
|
-
|
351
|
+
dicom_tag_templates[:acquisition_matrix_y] = {
|
345
352
|
:type => :int,
|
346
353
|
:pat => /IMG Columns\/\/ ([0-9]+)/i,
|
347
354
|
:required => false
|
348
355
|
}
|
349
|
-
|
356
|
+
dicom_tag_templates[:num_slices] = {
|
350
357
|
:type => :int,
|
351
358
|
:pat => /REL Images in Acquisition\/\/([0-9]+)/i,
|
352
359
|
:required => false
|
353
360
|
}
|
354
|
-
|
361
|
+
dicom_tag_templates[:bold_reps] = {
|
355
362
|
:type => :int,
|
356
363
|
:pat => /REL Number of Temporal Positions\/\/([0-9]+)/i,
|
357
364
|
:required => false
|
358
365
|
}
|
359
|
-
|
366
|
+
dicom_tag_templates[:rep_time] = {
|
360
367
|
:type => :float,
|
361
368
|
:pat => /ACQ Repetition Time\/\/(.*)\n/i,
|
362
369
|
:required => false
|
363
370
|
}
|
364
|
-
|
371
|
+
dicom_tag_templates[:date] = {
|
365
372
|
:type => :datetime,
|
366
373
|
:pat => /ID STUDY DATE\/\/(.*)\n/i #,
|
367
374
|
# :required => false
|
368
375
|
}
|
369
|
-
|
376
|
+
dicom_tag_templates[:time] = {
|
370
377
|
:type => :datetime,
|
371
378
|
:pat => /ID Series Time\/\/(.*)\n/i #,
|
372
379
|
# :required => false
|
373
380
|
}
|
374
381
|
|
375
|
-
|
382
|
+
dicom_tag_templates.each_pair do |name, tag_hash|
|
376
383
|
begin
|
377
384
|
next if tag_hash[:type] == :datetime
|
378
385
|
tag_hash[:pat] =~ @hdr_data
|
@@ -393,9 +400,9 @@ utility.
|
|
393
400
|
end
|
394
401
|
|
395
402
|
# Set Timestamp separately because it requires both Date and Time to be extracted.
|
396
|
-
|
403
|
+
dicom_tag_templates[:date][:pat] =~ @hdr_data
|
397
404
|
date = $1
|
398
|
-
|
405
|
+
dicom_tag_templates[:time][:pat] =~ @hdr_data
|
399
406
|
time = $1
|
400
407
|
@timestamp = DateTime.parse(date + time)
|
401
408
|
|
@@ -48,6 +48,8 @@ class VisitRawDataDirectory
|
|
48
48
|
attr_reader :scan_procedure_name
|
49
49
|
# scanner source
|
50
50
|
attr_accessor :scanner_source
|
51
|
+
# scanner-defined study id / exam number
|
52
|
+
attr_accessor :study_id
|
51
53
|
#
|
52
54
|
attr_accessor :db
|
53
55
|
# Scan ID is the short name for the scan (tbiva018, tbiva018b)
|
@@ -71,6 +73,7 @@ class VisitRawDataDirectory
|
|
71
73
|
@rmr_number = nil
|
72
74
|
@scan_procedure_name = scan_procedure_name.nil? ? get_scan_procedure_based_on_raw_directory : scan_procedure_name
|
73
75
|
@db = nil
|
76
|
+
@study_id = nil
|
74
77
|
initialize_log
|
75
78
|
end
|
76
79
|
|
@@ -94,6 +97,7 @@ class VisitRawDataDirectory
|
|
94
97
|
@timestamp = get_visit_timestamp
|
95
98
|
@rmr_number = get_rmr_number
|
96
99
|
@scanner_source = get_scanner_source
|
100
|
+
@study_id = get_study_id
|
97
101
|
flash "Completed scanning #{@visit_directory}" if $LOG.level <= Logger::DEBUG
|
98
102
|
else
|
99
103
|
raise(IndexError, "No datasets could be scanned for directory #{@visit_directory}")
|
@@ -106,7 +110,8 @@ class VisitRawDataDirectory
|
|
106
110
|
:date => @timestamp.to_s,
|
107
111
|
:rmr => @rmr_number,
|
108
112
|
:path => @visit_directory,
|
109
|
-
:scanner_source => get_scanner_source
|
113
|
+
:scanner_source => @scanner_source ||= get_scanner_source,
|
114
|
+
:scan_number => @study_id
|
110
115
|
}
|
111
116
|
end
|
112
117
|
|
@@ -183,7 +188,7 @@ Returns an array of the created nifti files.
|
|
183
188
|
def to_s
|
184
189
|
puts; @visit_directory.length.times { print "-" }; puts
|
185
190
|
puts "#{@visit_directory}"
|
186
|
-
puts "#{@rmr_number} - #{@timestamp.strftime('%F')} - #{@scanner_source}"
|
191
|
+
puts "#{@rmr_number} - #{@timestamp.strftime('%F')} - #{@scanner_source} - #{@study_id unless @study_id.nil?}"
|
187
192
|
puts
|
188
193
|
puts RawImageDataset.to_table(@datasets)
|
189
194
|
return
|
@@ -363,6 +368,14 @@ generates an sql insert statement to insert this visit with a given participant
|
|
363
368
|
raise(IOError, "No valid scanner source found for this visit")
|
364
369
|
end
|
365
370
|
|
371
|
+
# retrieves exam number / scan id from first #RawImageDataset
|
372
|
+
def get_study_id
|
373
|
+
@datasets.each do |ds|
|
374
|
+
return ds.study_id unless ds.study_id.nil?
|
375
|
+
end
|
376
|
+
# raise(IOError, "No valid study id / exam number found.")
|
377
|
+
end
|
378
|
+
|
366
379
|
def get_scan_procedure_based_on_raw_directory
|
367
380
|
case @visit_directory
|
368
381
|
when /alz_2000.*_2$/
|
data/lib/metamri.rb
CHANGED
@@ -4,10 +4,12 @@ require 'metamri/core_additions'
|
|
4
4
|
require 'metamri/raw_image_file'
|
5
5
|
require 'metamri/raw_image_dataset'
|
6
6
|
require 'metamri/visit_raw_data_directory'
|
7
|
-
require 'metamri/raw_image_dataset_thumbnail'
|
8
7
|
require 'metamri/raw_image_dataset_resource'
|
9
8
|
require 'metamri/visit_raw_data_directory_resource'
|
10
9
|
|
10
|
+
# require 'metamri/raw_image_dataset_thumbnail'
|
11
|
+
# TODO Move raw_image_dataset_thumbnail out of metamri.
|
12
|
+
|
11
13
|
begin
|
12
14
|
require 'hirb'
|
13
15
|
rescue LoadError
|
data/metamri.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{metamri}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.18"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristopher J. Kosmatka"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-06-04}
|
13
13
|
s.description = %q{Extraction of MRI metadata and insertion into compatible sqlite3 databases.}
|
14
14
|
s.email = %q{kk4@medicine.wisc.edu}
|
15
15
|
s.executables = ["import_study.rb", "import_visit.rb", "import_respiratory_files.rb", "list_visit", "convert_visit.rb"]
|
@@ -67,13 +67,16 @@ Gem::Specification.new do |s|
|
|
67
67
|
|
68
68
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
69
69
|
s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 0"])
|
70
|
+
s.add_runtime_dependency(%q<dicom>, [">= 0"])
|
70
71
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
71
72
|
else
|
72
73
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
74
|
+
s.add_dependency(%q<dicom>, [">= 0"])
|
73
75
|
s.add_dependency(%q<rspec>, [">= 0"])
|
74
76
|
end
|
75
77
|
else
|
76
78
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
79
|
+
s.add_dependency(%q<dicom>, [">= 0"])
|
77
80
|
s.add_dependency(%q<rspec>, [">= 0"])
|
78
81
|
end
|
79
82
|
end
|
data/test/nifti_builder_spec.rb
CHANGED
@@ -4,14 +4,11 @@ require 'rubygems'
|
|
4
4
|
require 'spec'
|
5
5
|
require 'fileutils'
|
6
6
|
require 'tmpdir'
|
7
|
-
require 'metamri
|
8
|
-
require 'visit_raw_data_directory'
|
9
|
-
require 'raw_image_dataset'
|
10
|
-
require 'raw_image_file'
|
7
|
+
require 'metamri'
|
11
8
|
|
12
|
-
VISIT_FIXTURE_SRC = '/Data/vtrak1/raw/johnson.tbi-va.visit1/
|
13
|
-
VISIT_FIXTURE = File.join(Dir.tmpdir, 'fixtures/visit_raw_data_directory/
|
14
|
-
VISIT_FIXTURE_UNZIPPED = File.join(Dir.tmpdir, 'fixtures/visit_raw_data_directory/
|
9
|
+
VISIT_FIXTURE_SRC = '/Data/vtrak1/raw/johnson.tbi-va.visit1/tbiva034_10019_04212010'
|
10
|
+
VISIT_FIXTURE = File.join(Dir.tmpdir, 'fixtures/visit_raw_data_directory/tbiva034_10019_04212010')
|
11
|
+
VISIT_FIXTURE_UNZIPPED = File.join(Dir.tmpdir, 'fixtures/visit_raw_data_directory/tbiva034_10019_04212010_unzipped')
|
15
12
|
|
16
13
|
|
17
14
|
|
@@ -102,7 +99,7 @@ describe "Convert Unknown Dicoms to Nifti Files" do
|
|
102
99
|
end
|
103
100
|
|
104
101
|
it "should guess scan id" do
|
105
|
-
@visit.scanid.should == '
|
102
|
+
@visit.scanid.should == 'tbiva034'
|
106
103
|
|
107
104
|
v = VisitRawDataDirectory.new('/Data/vtrak1/preprocessed/visits/asthana.adrc-clinical-core.visit1/adrc00001', 'asthana.adrc-clinical-core.visit1')
|
108
105
|
v.scanid.should == 'adrc00001'
|
@@ -4,8 +4,8 @@
|
|
4
4
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
5
5
|
|
6
6
|
require 'test/unit'
|
7
|
-
require 'raw_image_dataset'
|
8
|
-
require 'raw_image_file'
|
7
|
+
require 'metamri/raw_image_dataset'
|
8
|
+
require 'metamri/raw_image_file'
|
9
9
|
|
10
10
|
class RawImageDatasetTest < Test::Unit::TestCase
|
11
11
|
DBFILE = 'fixtures/development.sqlite3'
|
@@ -3,9 +3,10 @@ $:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
|
3
3
|
require 'spec'
|
4
4
|
require 'escoffier'
|
5
5
|
require 'tmpdir'
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require 'metamri'
|
6
|
+
# require 'metamri'
|
7
|
+
require 'metamri/core_additions'
|
8
|
+
require 'metamri/raw_image_dataset'
|
9
|
+
require 'metamri/raw_image_file'
|
9
10
|
require 'metamri/raw_image_dataset_thumbnail'
|
10
11
|
|
11
12
|
describe "Create a thumbnail png for display." do
|
data/test/raw_image_file_test.rb
CHANGED
@@ -4,29 +4,29 @@
|
|
4
4
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
5
5
|
|
6
6
|
require 'test/unit'
|
7
|
-
require 'raw_image_file'
|
7
|
+
require 'metamri/raw_image_file'
|
8
8
|
|
9
9
|
class RawImageFileTest < Test::Unit::TestCase
|
10
10
|
def setup
|
11
|
-
@
|
12
|
-
@
|
11
|
+
@GE_IFile = 'fixtures/I.001'
|
12
|
+
@Dicom = 'fixtures/S4_EFGRE3D.0001'
|
13
13
|
@EarlyGEPfile = 'fixtures/P59392.7'
|
14
14
|
@LateGEPfile = 'fixtures/P27648.7'
|
15
15
|
@notafile = 'fixtures/XXX.XXX'
|
16
|
-
@ged = RawImageFile.new(@
|
17
|
-
@did = RawImageFile.new(@
|
16
|
+
@ged = RawImageFile.new(@GE_IFile)
|
17
|
+
@did = RawImageFile.new(@Dicom)
|
18
18
|
@egep = RawImageFile.new(@EarlyGEPfile)
|
19
19
|
@lgep = RawImageFile.new(@LateGEPfile)
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_gehdr_dicom_init
|
23
23
|
assert_nothing_raised do
|
24
|
-
RawImageFile.new(@
|
24
|
+
RawImageFile.new(@GE_IFile)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
def test_dicomhdr_dicom_init
|
28
28
|
assert_nothing_raised do
|
29
|
-
RawImageFile.new(@
|
29
|
+
RawImageFile.new(@Dicom)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
def test_early_gehdr_pfile_init
|
@@ -4,8 +4,8 @@
|
|
4
4
|
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
5
5
|
|
6
6
|
require 'test/unit'
|
7
|
-
require 'visit'
|
8
7
|
require 'pathname'
|
8
|
+
require 'metamri'
|
9
9
|
|
10
10
|
|
11
11
|
class RawImageFileTest < Test::Unit::TestCase
|
@@ -16,7 +16,7 @@ class RawImageFileTest < Test::Unit::TestCase
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_scan_and_insert
|
19
|
-
@v =
|
19
|
+
@v = VisitRawDataDirectory.new( '/Data/vtrak1/raw/alz_2000/alz093', 'ALZ' )
|
20
20
|
@v.scan
|
21
21
|
@v.init_db(DBFILE)
|
22
22
|
@v.db_insert!
|
data/test/visit_test.rb
CHANGED
@@ -9,7 +9,7 @@ require 'logger'
|
|
9
9
|
require 'metamri'
|
10
10
|
|
11
11
|
class RawImageFileTest < Test::Unit::TestCase
|
12
|
-
DBFILE = '/
|
12
|
+
DBFILE = '~/code/WADRC-Data-Tools/db/development.sqlite3'
|
13
13
|
$LOG = Logger.new('visit_test.log', shift_age = 7, shift_size = 1048576)
|
14
14
|
STUDIES = [
|
15
15
|
# Pathname.new('/Data/vtrak1/raw/alz_2000'),
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 18
|
9
|
+
version: 0.1.18
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristopher J. Kosmatka
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-04 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
type: :runtime
|
31
31
|
version_requirements: *id001
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
|
-
name:
|
33
|
+
name: dicom
|
34
34
|
prerelease: false
|
35
35
|
requirement: &id002 !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
@@ -39,8 +39,20 @@ dependencies:
|
|
39
39
|
segments:
|
40
40
|
- 0
|
41
41
|
version: "0"
|
42
|
-
type: :
|
42
|
+
type: :runtime
|
43
43
|
version_requirements: *id002
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: rspec
|
46
|
+
prerelease: false
|
47
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
type: :development
|
55
|
+
version_requirements: *id003
|
44
56
|
description: Extraction of MRI metadata and insertion into compatible sqlite3 databases.
|
45
57
|
email: kk4@medicine.wisc.edu
|
46
58
|
executables:
|