Closed dietzc closed 9 years ago
@dietzc Sounds good. You could add it to net.imglib2.roi.util.Util
@tpietzsch how would I do it outside the LabelingType
?
right, the constructor is protected... yes, then in the LabelingType
I will make a PR.
I know I am super anal about this, but can we consider renaming the class called Util
? I really like how ImgLib2 (and core Java e.g. Arrays
) name some utility classes with plurals. We could have a utility class called ROIs
.
@ctrueden Sure, lets rename it! How about RoiUtils
? I would like to reserve Regions
for the Views
-like static methods and ROIs
maybe comes confusingly close.
@tpietzsch OK, how about ROIUtils
then? The SciJava naming convention is to avoid camel-casing acronyms, but instead keep them up-case. Though if you want to establish a different convention for ImgLib2 naming in general, I am OK with that, as long as it's consistent.
@ctrueden I have no strong preference. ROIUtils
is fine.
@tpietzsch another one:
to create a
LabelingType<L>
I usually use the underlyingRandomAccessibleInterval<LabelingType<L>>
and create another variable from the first element. However, assume you want to create aLabelingType<V>
. There is no way to create an emptyLabelingType<V>
without having anotherLabelingType<V>
at hand. Could we add a helper method for that to LabelingType?static <V> createLabelingType(final Class<V> v){ ... }
?Use-case: Read-only converters.