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
Hide 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) {
...
@@ -5984,9 +5984,15 @@ if (MORE_BUTTONS) {
IJ
.
showMessage
(
"LENS_DISTORTION.fittingStrategy is not set"
);
IJ
.
showMessage
(
"LENS_DISTORTION.fittingStrategy is not set"
);
return
;
return
;
}
}
boolean
[]
selectedChannels
=
null
;
if
(
ABERRATIONS_PARAMETERS
!=
null
){
selectedChannels
=
ABERRATIONS_PARAMETERS
.
getChannelSelection
(
LENS_DISTORTIONS
);
}
LENS_DISTORTIONS
.
removeOutLayers
(
LENS_DISTORTIONS
.
removeOutLayers
(
-
1
,
//int series, (<0 - ask)
-
1
,
//int series, (<0 - ask)
-
1
//int numOutLayers (<0 - ask)
-
1
,
//int numOutLayers (<0 - ask)
selectedChannels
);
);
return
;
return
;
}
}
...
...
src/main/java/Distortions.java
View file @
5ca7d76c
...
@@ -3676,36 +3676,56 @@ List calibration
...
@@ -3676,36 +3676,56 @@ List calibration
return true;
return true;
}
}
public boolean removeOutLayers(int series, int numOutLayers){
public boolean removeOutLayers(
int series,
int numOutLayers,
boolean [] selectedChannels){
int numSeries=fittingStrategy.getNumSeries();
int numSeries=fittingStrategy.getNumSeries();
boolean removeEmpty=false;
boolean removeEmpty=false;
boolean recalculate=false;
boolean recalculate=false;
boolean applyChannelFilter=false;
int filter=filterForAll;
int filter=filterForAll;
if ((series<0) || (numOutLayers<0)) {
if ((series<0) || (numOutLayers<0)) {
GenericDialog gd = new GenericDialog("Select series to process");
GenericDialog gd = new GenericDialog("Select series to process");
gd.addNumericField("Iteration number to start (0.."+(numSeries-1)+")", this.seriesNumber, 0);
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.addCheckbox("Recalculate parameters vector from selected strategy",recalculate);
gd.addNumericField("Number of outlayers to show", 10, 0);
gd.addNumericField("Number of outlayers to show", 10, 0);
gd.addCheckbox("Remove empty (rms==NaN) images", removeEmpty);
gd.addCheckbox("Remove empty (rms==NaN) images", removeEmpty);
gd.addCheckbox("Ask filter (current filter="+filter+")", this.askFilter);
gd.addCheckbox("Ask filter (current filter="+filter+")", this.askFilter);
gd.showDialog();
gd.showDialog();
if (gd.wasCanceled()) return false;
if (gd.wasCanceled()) return false;
this.seriesNumber= (int) gd.getNextNumber();
this.seriesNumber= (int) gd.getNextNumber();
recalculate= gd.getNextBoolean();
if (selectedChannels != null) applyChannelFilter= gd.getNextBoolean();
numOutLayers= (int) gd.getNextNumber();
recalculate= gd.getNextBoolean();
removeEmpty= gd.getNextBoolean();
numOutLayers= (int) gd.getNextNumber();
this.askFilter= gd.getNextBoolean();
removeEmpty= gd.getNextBoolean();
this.askFilter= gd.getNextBoolean();
if (this.askFilter) filter= selectFilter(filter);
if (this.askFilter) filter= selectFilter(filter);
filter=0;
filter=0;
} else {
} else {
this.seriesNumber=series;
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
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)
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 [] errors=calcErrors(calcYminusFx(this.currentfX)); // seem to have errors? - now may return NaN!
double rms= calcError (calcYminusFx(this.currentfX));
double rms= calcError (calcYminusFx(this.currentfX));
boolean [] selectedImages=fittingStrategy.selectedImages();
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 numSelectedNotNaNImages=0;
int numNaN=0;
int numNaN=0;
for (int i=0;i<selectedImages.length;i++) if (selectedImages[i]) {
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