Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
EzPlug
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bioimage Analysis
EzPlug
Commits
52ccc7b4
Commit
52ccc7b4
authored
3 years ago
by
Stéphane DALLONGEVILLE
Browse files
Options
Downloads
Patches
Plain Diff
Added VarROIDescriptor variable for easy ROI Descriptor selector
parent
1ba47c63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/plugins/adufour/vars/lang/VarROIDescriptor.java
+55
-0
55 additions, 0 deletions
...main/java/plugins/adufour/vars/lang/VarROIDescriptor.java
with
55 additions
and
0 deletions
src/main/java/plugins/adufour/vars/lang/VarROIDescriptor.java
0 → 100644
+
55
−
0
View file @
52ccc7b4
package
plugins.adufour.vars.lang
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
icy.roi.ROIDescriptor
;
import
icy.util.StringUtil
;
import
plugins.adufour.vars.gui.model.ValueSelectionModel
;
import
plugins.kernel.roi.descriptor.measure.ROIInteriorDescriptor
;
/**
* EzVar representing {@link ROIDescriptor} selector
*
* @author Stephane.D
*/
public
class
VarROIDescriptor
extends
VarString
{
/**
* @param name
* Variable name
*/
public
VarROIDescriptor
(
String
name
)
{
super
(
name
,
""
);
final
List
<
ROIDescriptor
>
roiDescriptors
=
new
ArrayList
<>(
ROIDescriptor
.
getDescriptors
().
keySet
());
// build list of descriptor id
final
List
<
String
>
descriptorsId
=
new
ArrayList
<>();
String
sizeDescriptorId
=
null
;
for
(
ROIDescriptor
descriptor
:
roiDescriptors
)
{
final
String
id
=
descriptor
.
getId
();
// keep trace of size descriptor
if
(
StringUtil
.
equals
(
ROIInteriorDescriptor
.
ID
,
id
))
sizeDescriptorId
=
id
;
descriptorsId
.
add
(
id
);
}
// alpha sort
Collections
.
sort
(
descriptorsId
);
// initialize descriptors field
setDefaultEditorModel
(
new
ValueSelectionModel
<>(
descriptorsId
.
toArray
(
new
String
[
descriptorsId
.
size
()]),
sizeDescriptorId
,
false
));
}
public
VarROIDescriptor
()
{
this
(
"Descriptor"
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment