Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bioimage Analysis
ROI blocks
Commits
0709901c
Commit
0709901c
authored
Jun 23, 2020
by
Daniel Felipe GONZALEZ OBANDO
Browse files
Added normalization code for string color values.
Now colors are converted to lowercase values before being compared.
parent
6ae88226
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/stef/roi/bloc/op/FilterROI.java
View file @
0709901c
...
...
@@ -28,6 +28,7 @@ import plugins.adufour.vars.lang.VarSequence;
import
plugins.adufour.vars.lang.VarString
;
import
plugins.adufour.vars.util.VarException
;
import
plugins.kernel.roi.descriptor.measure.ROIInteriorDescriptor
;
import
plugins.kernel.roi.descriptor.property.ROIColorDescriptor
;
import
plugins.stef.roi.bloc.RoiBlocks
;
/**
...
...
@@ -270,7 +271,16 @@ public class FilterROI extends Plugin implements ROIBlock, PluginLibrary, Plugin
// try to get the type behind
final
Object
typedValue
=
getTypedValue
(
value
);
// get regex from String
final
String
regexValue
=
StringUtil
.
wildcardToRegex
(
value
);
final
String
regexValue
;
if
(
roiDescriptor
instanceof
ROIColorDescriptor
)
{
regexValue
=
StringUtil
.
wildcardToRegex
(
value
.
toLowerCase
());
value
=
value
.
toLowerCase
();
}
else
{
regexValue
=
StringUtil
.
wildcardToRegex
(
value
);
}
// number comparison
if
(
typedValue
instanceof
Number
)
...
...
@@ -337,7 +347,7 @@ public class FilterROI extends Plugin implements ROIBlock, PluginLibrary, Plugin
else
if
(
res
instanceof
String
)
stringRes
=
(
String
)
res
;
else
if
(
res
instanceof
Color
)
stringRes
=
colorToString
((
Color
)
res
);
stringRes
=
colorToString
((
Color
)
res
)
.
toLowerCase
()
;
else
if
(
res
!=
null
)
stringRes
=
res
.
toString
();
else
...
...
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