cicada 0.9.4-java → 0.9.5-java
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cicada.rb +0 -3
- data/lib/cicada/aberration_map.rb +2 -20
- data/lib/cicada/cicada_main.rb +44 -234
- data/lib/cicada/correction/correction.rb +1 -94
- data/lib/cicada/correction/in_situ_correction.rb +67 -0
- data/lib/cicada/correction/position_corrector.rb +14 -164
- data/lib/cicada/correction/unable_to_correct_error.rb +30 -0
- data/lib/cicada/file_interaction.rb +5 -98
- data/lib/cicada/fitting/p3d_fitter.rb +3 -45
- data/lib/cicada/mutable_matrix.rb +0 -21
- data/lib/cicada/version.rb +1 -5
- data/spec/cicada/cicada_main_spec.rb +62 -0
- data/spec/cicada/correction/position_corrector_spec.rb +3 -4
- data/spec/spec_helper.rb +3 -5
- metadata +28 -37
@@ -43,13 +43,9 @@ class Matrix
|
|
43
43
|
# to the specified row.
|
44
44
|
#
|
45
45
|
def replace_row(i, other)
|
46
|
-
|
47
46
|
column_size.times do |j|
|
48
|
-
|
49
47
|
self[i, j]= other[j]
|
50
|
-
|
51
48
|
end
|
52
|
-
|
53
49
|
end
|
54
50
|
|
55
51
|
##
|
@@ -60,17 +56,12 @@ class Matrix
|
|
60
56
|
# to the specified column.
|
61
57
|
#
|
62
58
|
def replace_column(j, other)
|
63
|
-
|
64
59
|
row_size.times do |i|
|
65
|
-
|
66
60
|
self[i, j]= other[i]
|
67
|
-
|
68
61
|
end
|
69
|
-
|
70
62
|
end
|
71
63
|
|
72
64
|
public :[]=
|
73
|
-
|
74
65
|
end
|
75
66
|
|
76
67
|
##
|
@@ -87,9 +78,7 @@ class MVector < Vector
|
|
87
78
|
# @return [MVector] a mutable vector of specified size containing all 0.0
|
88
79
|
#
|
89
80
|
def MVector.zero(size)
|
90
|
-
|
91
81
|
elements(Array.new(size, 0.0), false)
|
92
|
-
|
93
82
|
end
|
94
83
|
|
95
84
|
##
|
@@ -100,9 +89,7 @@ class MVector < Vector
|
|
100
89
|
# @return [MVector] a mutable vector of specified size containing all 1.0
|
101
90
|
#
|
102
91
|
def MVector.unit(size)
|
103
|
-
|
104
92
|
MVector.elements(Array.new(size, 1.0), false)
|
105
|
-
|
106
93
|
end
|
107
94
|
|
108
95
|
##
|
@@ -116,18 +103,10 @@ class MVector < Vector
|
|
116
103
|
# @return [void]
|
117
104
|
#
|
118
105
|
def replace(other)
|
119
|
-
|
120
106
|
self.each_with_index do |e,i|
|
121
|
-
|
122
107
|
self[i] = other[i]
|
123
|
-
|
124
108
|
end
|
125
|
-
|
126
109
|
end
|
127
110
|
|
128
|
-
|
129
111
|
public :[]=
|
130
|
-
|
131
|
-
|
132
112
|
end
|
133
|
-
|
data/lib/cicada/version.rb
CHANGED
@@ -0,0 +1,62 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2013 Colin J. Fuller
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the Software), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
#++
|
22
|
+
|
23
|
+
require 'logger'
|
24
|
+
|
25
|
+
require 'spec_helper'
|
26
|
+
|
27
|
+
require 'cicada/correction/position_corrector'
|
28
|
+
require 'cicada/correction/correction'
|
29
|
+
require 'cicada/correction/in_situ_correction'
|
30
|
+
require 'cicada/cicada_main'
|
31
|
+
require 'cicada/file_interaction'
|
32
|
+
|
33
|
+
describe Cicada do
|
34
|
+
|
35
|
+
before :each do
|
36
|
+
@p = {}
|
37
|
+
setup_default_parameters(@p)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should not give an error when trying not to perform any correction and the correction file does not exist on disk" do
|
41
|
+
@p[:determine_correction] = false
|
42
|
+
@p[:correct_images] = false
|
43
|
+
cic = Cicada::CicadaMain.new(@p)
|
44
|
+
|
45
|
+
cic.class.class_eval do
|
46
|
+
define_method :do_and_save_fits do
|
47
|
+
load_iobjs
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
Cicada::FileInteraction.class_eval do
|
52
|
+
def self.write_position_data(iobjs, params)
|
53
|
+
nil
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
expect { cic.go }.not_to raise_exception
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
|
@@ -36,9 +36,8 @@ require 'ostruct'
|
|
36
36
|
describe Cicada::PositionCorrector do
|
37
37
|
|
38
38
|
before :each do
|
39
|
-
|
40
|
-
@p
|
41
|
-
|
39
|
+
@p = {}
|
40
|
+
setup_default_parameters(@p)
|
42
41
|
end
|
43
42
|
|
44
43
|
it "should generate a correction correctly" do
|
@@ -115,7 +114,7 @@ describe Cicada::PositionCorrector do
|
|
115
114
|
|
116
115
|
pc = Cicada::PositionCorrector.new(@p)
|
117
116
|
|
118
|
-
corr = pc.generate_in_situ_correction_from_iobjs(load_iobjs)
|
117
|
+
corr = pc.generate_in_situ_correction_from_iobjs(load_iobjs).corr_parameters.transpose
|
119
118
|
|
120
119
|
x_corr = corr[0]
|
121
120
|
y_corr = corr[1]
|
data/spec/spec_helper.rb
CHANGED
@@ -35,16 +35,14 @@ OBJ_FN = "./spec/resources/beads_sim_data.xml"
|
|
35
35
|
CORR_FN = "./spec/resources/sim_correction.xml"
|
36
36
|
|
37
37
|
def load_correction
|
38
|
-
|
39
38
|
Cicada::Correction.read_from_file(CORR_FN)
|
40
|
-
|
41
39
|
end
|
42
40
|
|
43
|
-
|
44
41
|
def load_iobjs
|
45
|
-
|
46
42
|
Cicada::FileInteraction.unserialize_position_data_file(OBJ_FN)
|
47
|
-
|
48
43
|
end
|
49
44
|
|
45
|
+
def setup_default_parameters(var)
|
46
|
+
var.merge!({reference_channel: 0, channel_to_correct: 1, half_box_size: 3, half_z_size: 5, pixelsize_nm: 80, z_sectionsize_nm: 100, num_points: 36, num_wavelengths: 3, log_detailed_messages: true, max_threads: 10, photons_per_greylevel: 0.125, determine_correction: true, fit_error_cutoff: 10, correct_images: true})
|
47
|
+
end
|
50
48
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cicada
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
prerelease:
|
6
6
|
platform: java
|
7
7
|
authors:
|
@@ -15,17 +15,15 @@ dependencies:
|
|
15
15
|
name: pqueue
|
16
16
|
version_requirements: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
21
|
-
MA==
|
20
|
+
version: '0'
|
22
21
|
none: false
|
23
22
|
requirement: !ruby/object:Gem::Requirement
|
24
23
|
requirements:
|
25
|
-
- -
|
24
|
+
- - '>='
|
26
25
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
28
|
-
MA==
|
26
|
+
version: '0'
|
29
27
|
none: false
|
30
28
|
prerelease: false
|
31
29
|
type: :runtime
|
@@ -33,17 +31,15 @@ dependencies:
|
|
33
31
|
name: facets
|
34
32
|
version_requirements: !ruby/object:Gem::Requirement
|
35
33
|
requirements:
|
36
|
-
- -
|
34
|
+
- - '>='
|
37
35
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
39
|
-
MA==
|
36
|
+
version: '0'
|
40
37
|
none: false
|
41
38
|
requirement: !ruby/object:Gem::Requirement
|
42
39
|
requirements:
|
43
|
-
- -
|
40
|
+
- - '>='
|
44
41
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
46
|
-
MA==
|
42
|
+
version: '0'
|
47
43
|
none: false
|
48
44
|
prerelease: false
|
49
45
|
type: :runtime
|
@@ -51,17 +47,15 @@ dependencies:
|
|
51
47
|
name: rimageanalysistools
|
52
48
|
version_requirements: !ruby/object:Gem::Requirement
|
53
49
|
requirements:
|
54
|
-
- -
|
50
|
+
- - '>='
|
55
51
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
57
|
-
MA==
|
52
|
+
version: '0'
|
58
53
|
none: false
|
59
54
|
requirement: !ruby/object:Gem::Requirement
|
60
55
|
requirements:
|
61
|
-
- -
|
56
|
+
- - '>='
|
62
57
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
64
|
-
MA==
|
58
|
+
version: '0'
|
65
59
|
none: false
|
66
60
|
prerelease: false
|
67
61
|
type: :runtime
|
@@ -69,17 +63,15 @@ dependencies:
|
|
69
63
|
name: trollop
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
|
-
- -
|
66
|
+
- - '>='
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
75
|
-
MA==
|
68
|
+
version: '0'
|
76
69
|
none: false
|
77
70
|
requirement: !ruby/object:Gem::Requirement
|
78
71
|
requirements:
|
79
|
-
- -
|
72
|
+
- - '>='
|
80
73
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
82
|
-
MA==
|
74
|
+
version: '0'
|
83
75
|
none: false
|
84
76
|
prerelease: false
|
85
77
|
type: :runtime
|
@@ -87,17 +79,15 @@ dependencies:
|
|
87
79
|
name: rspec
|
88
80
|
version_requirements: !ruby/object:Gem::Requirement
|
89
81
|
requirements:
|
90
|
-
- -
|
82
|
+
- - '>='
|
91
83
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
93
|
-
MA==
|
84
|
+
version: '0'
|
94
85
|
none: false
|
95
86
|
requirement: !ruby/object:Gem::Requirement
|
96
87
|
requirements:
|
97
|
-
- -
|
88
|
+
- - '>='
|
98
89
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
100
|
-
MA==
|
90
|
+
version: '0'
|
101
91
|
none: false
|
102
92
|
prerelease: false
|
103
93
|
type: :development
|
@@ -118,10 +108,13 @@ files:
|
|
118
108
|
- lib/cicada/version.rb
|
119
109
|
- lib/cicada/correction/position_corrector.rb
|
120
110
|
- lib/cicada/correction/correction.rb
|
111
|
+
- lib/cicada/correction/in_situ_correction.rb
|
112
|
+
- lib/cicada/correction/unable_to_correct_error.rb
|
121
113
|
- lib/cicada/fitting/p3d_fitter.rb
|
122
114
|
- spec/spec_helper.rb
|
123
115
|
- spec/cicada/file_interaction_spec.rb
|
124
116
|
- spec/cicada/mutable_matrix_spec.rb
|
117
|
+
- spec/cicada/cicada_main_spec.rb
|
125
118
|
- spec/cicada/correction/position_corrector_spec.rb
|
126
119
|
- spec/cicada/correction/correction_spec.rb
|
127
120
|
- spec/cicada/fitting/p3d_fitter_spec.rb
|
@@ -137,17 +130,15 @@ require_paths:
|
|
137
130
|
- lib
|
138
131
|
required_ruby_version: !ruby/object:Gem::Requirement
|
139
132
|
requirements:
|
140
|
-
- -
|
133
|
+
- - '>='
|
141
134
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
143
|
-
MA==
|
135
|
+
version: '0'
|
144
136
|
none: false
|
145
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
138
|
requirements:
|
147
|
-
- -
|
139
|
+
- - '>='
|
148
140
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
150
|
-
MA==
|
141
|
+
version: '0'
|
151
142
|
none: false
|
152
143
|
requirements:
|
153
144
|
- jruby
|