Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
5ca7d76c
Commit
5ca7d76c
authored
Nov 08, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added channel filter to "Remove Outlayers"
parent
59e08875
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
7 deletions
+33
-7
Aberration_Calibration.java
src/main/java/Aberration_Calibration.java
+7
-1
Distortions.java
src/main/java/Distortions.java
+26
-6
No files found.
src/main/java/Aberration_Calibration.java
View file @
5ca7d76c
...
...
@@ -5984,9 +5984,15 @@ if (MORE_BUTTONS) {
IJ
.
showMessage
(
"LENS_DISTORTION.fittingStrategy is not set"
);
return
;
}
boolean
[]
selectedChannels
=
null
;
if
(
ABERRATIONS_PARAMETERS
!=
null
){
selectedChannels
=
ABERRATIONS_PARAMETERS
.
getChannelSelection
(
LENS_DISTORTIONS
);
}
LENS_DISTORTIONS
.
removeOutLayers
(
-
1
,
//int series, (<0 - ask)
-
1
//int numOutLayers (<0 - ask)
-
1
,
//int numOutLayers (<0 - ask)
selectedChannels
);
return
;
}
...
...
src/main/java/Distortions.java
View file @
5ca7d76c
...
...
@@ -3676,14 +3676,23 @@ List calibration
return true;
}
public boolean removeOutLayers(int series, int numOutLayers){
public boolean removeOutLayers(
int series,
int numOutLayers,
boolean [] selectedChannels){
int numSeries=fittingStrategy.getNumSeries();
boolean removeEmpty=false;
boolean recalculate=false;
boolean applyChannelFilter=false;
int filter=filterForAll;
if ((series<0) || (numOutLayers<0)) {
GenericDialog gd = new GenericDialog("Select series to process");
gd.addNumericField("Iteration number to start (0.."+(numSeries-1)+")", this.seriesNumber, 0);
if (selectedChannels != null) {
String s="";
for (boolean b:selectedChannels)s+=b?"+":"-";
gd.addCheckbox("Filter by channel selection ("+s+")", applyChannelFilter);
}
gd.addCheckbox("Recalculate parameters vector from selected strategy",recalculate);
gd.addNumericField("Number of outlayers to show", 10, 0);
gd.addCheckbox("Remove empty (rms==NaN) images", removeEmpty);
...
...
@@ -3691,6 +3700,7 @@ List calibration
gd.showDialog();
if (gd.wasCanceled()) return false;
this.seriesNumber= (int) gd.getNextNumber();
if (selectedChannels != null) applyChannelFilter= gd.getNextBoolean();
recalculate= gd.getNextBoolean();
numOutLayers= (int) gd.getNextNumber();
removeEmpty= gd.getNextBoolean();
...
...
@@ -3700,12 +3710,22 @@ List calibration
} else {
this.seriesNumber=series;
}
if (!applyChannelFilter) selectedChannels=null;
// initFittingSeries(!recalculate,this.filterForAll,this.seriesNumber); // will set this.currentVector
initFittingSeries(!recalculate,this.filterForAll,this.seriesNumber); // will set this.currentVector
this.currentfX=calculateFxAndJacobian(this.currentVector, false); // is it always true here (this.jacobian==null)
double [] errors=calcErrors(calcYminusFx(this.currentfX)); // seem to have errors? - now may return NaN!
double rms= calcError (calcYminusFx(this.currentfX));
boolean [] selectedImages=fittingStrategy.selectedImages();
if (selectedChannels!=null){
selectedImages=selectedImages.clone(); // disconnect from original for modification
for (int i=0;i<selectedImages.length;i++) if (selectedImages[i]){
int chn=this.fittingStrategy.distortionCalibrationData.gIP[i].channel;
if ((chn<0) || (chn>=selectedChannels.length) || !selectedChannels[chn]){
selectedImages[i]=false;
}
}
}
int numSelectedNotNaNImages=0;
int numNaN=0;
for (int i=0;i<selectedImages.length;i++) if (selectedImages[i]) {
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment