gdcm 1.0.1 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc661ce30ca66be350925ad91835536568e742fe1c88febf39072d9cb1a2926c
4
- data.tar.gz: fdc5ffc9e902922f2151d5247013385c5d4f026f117af810f74fcc825541b263
3
+ metadata.gz: 6078cd574362d83fd85f4e0e40db2d5862b9b0f5c4e666aa17d1e8a753fa35b1
4
+ data.tar.gz: d97f3b074bcf07ba54a2b3895cf3ce87b77e3a74117298cd9adedbdfb357447c
5
5
  SHA512:
6
- metadata.gz: 171cf47bfc5c1333ca5911ee933de3918d6c160dcc5dd106fcadd6826dfea29dcee0a3d9e10c2a2cf75592726757715caeb2b107090b2dd4e20ebdab2da2e8ce
7
- data.tar.gz: 642551a2b21a73ffb8b3659e6c128cae5d6970c219695e6d93cfdca0fcc4019c33dfc9ff9cdbde1d595b3525733294788522665a2c86547588d31ce56d55d9ac
6
+ metadata.gz: 9d7493f9d36b475897acdc785d4e0b8124dd0e8acc2baf1c0ddbecd4e19cf5503577bca22ccb96d73aff41bd2e59179ba59942d86f75cca3a8be5f4a822a1beb
7
+ data.tar.gz: 804abebb6747221589a072d508116bc5d7bbdd208fdf5091e3fbf11d69c982436ebb765111c1190addc2fb1a8d80eda18b2c470cb4081440209774ecc4dd4806
data/README.md CHANGED
@@ -150,8 +150,8 @@ end #=> `gdcmconv --raw --verbose input.dcm output.dcm`
150
150
  convert = GDCM::Tool::Convert.new
151
151
  convert.raw
152
152
  convert.verbose
153
- convert << "input.jpg"
154
- convert << "output.jpg"
153
+ convert << "input.dcm"
154
+ convert << "output.dcm"
155
155
  convert.call #=> `gdcmconv --raw --verbose input.dcm output.dcm`
156
156
  ```
157
157
 
@@ -1,10 +1,19 @@
1
1
  module GDCM
2
2
  class Package
3
3
  class Info
4
- attr_reader :package_instance
4
+ attr_reader :base
5
5
 
6
- def initialize package_instance
7
- @package_instance = package_instance
6
+ def initialize base
7
+ @base = base
8
+ end
9
+
10
+ def raw
11
+ dump.lines.each_with_object([]) do |line, memo|
12
+ case line
13
+ when /^\s*\((?<package>[0-9a-f]{4},[0-9a-f]{4})\)/
14
+ puts line
15
+ end
16
+ end
8
17
  end
9
18
 
10
19
  def data
@@ -28,14 +37,21 @@ module GDCM
28
37
  @meta ||= identify
29
38
  end
30
39
 
31
- def clear
32
- @meta = nil
40
+ def meta= value
41
+ @meta = value
42
+ end
43
+
44
+ def dump
45
+ GDCM::Tool::Dump.new do |builder|
46
+ yield builder if block_given?
47
+ builder << base.path
48
+ end
33
49
  end
34
50
 
35
51
  def identify
36
52
  GDCM::Tool::Identify.new do |builder|
37
53
  yield builder if block_given?
38
- builder << package_instance.path
54
+ builder << base.path
39
55
  end
40
56
  end
41
57
  end
data/lib/gdcm/package.rb CHANGED
@@ -106,15 +106,11 @@ module GDCM
106
106
  end
107
107
 
108
108
  def validate!
109
- identify
109
+ info.meta
110
110
  rescue GDCM::Error => error
111
111
  raise GDCM::Invalid, error.message
112
112
  end
113
113
 
114
- def identify
115
- info.identify
116
- end
117
-
118
114
  def convert
119
115
  if @tempfile
120
116
  new_tempfile = GDCM::Utilities.tempfile(".dcm")
@@ -139,7 +135,8 @@ module GDCM
139
135
  end
140
136
 
141
137
  path.replace new_path
142
- info.clear
138
+
139
+ info.meta = nil
143
140
 
144
141
  self
145
142
  end
@@ -0,0 +1,9 @@
1
+ module GDCM
2
+ class Tool
3
+ class Dump < GDCM::Tool
4
+ def initialize(*args)
5
+ super("gdcmdump", *args)
6
+ end
7
+ end
8
+ end
9
+ end
data/lib/gdcm/tool.rb CHANGED
@@ -213,5 +213,6 @@ module GDCM
213
213
  end
214
214
  end
215
215
 
216
+ require "gdcm/tool/dump"
216
217
  require "gdcm/tool/convert"
217
218
  require "gdcm/tool/identify"
data/lib/gdcm/version.rb CHANGED
@@ -9,7 +9,7 @@ module GDCM
9
9
  module VERSION
10
10
  MAJOR = 1
11
11
  MINOR = 0
12
- TINY = 1
12
+ TINY = 5
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gdcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sanzstez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-11 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -69,6 +69,7 @@ files:
69
69
  - lib/gdcm/shell.rb
70
70
  - lib/gdcm/tool.rb
71
71
  - lib/gdcm/tool/convert.rb
72
+ - lib/gdcm/tool/dump.rb
72
73
  - lib/gdcm/tool/identify.rb
73
74
  - lib/gdcm/utilities.rb
74
75
  - lib/gdcm/version.rb