|
38 | 38 | import net.imglib2.view.Views; |
39 | 39 |
|
40 | 40 | import org.scijava.Priority; |
41 | | -import org.scijava.types.TypeExtractor; |
42 | | -import org.scijava.types.TypeService; |
43 | | -import org.scijava.plugin.Parameter; |
44 | 41 | import org.scijava.plugin.Plugin; |
| 42 | +import org.scijava.types.TypeExtractor; |
| 43 | +import org.scijava.types.TypeReifier; |
45 | 44 |
|
46 | 45 | /** |
47 | 46 | * {@link TypeExtractor} plugin which operates on {@link Iterable} objects. |
|
56 | 55 | @Plugin(type = TypeExtractor.class, priority = Priority.LOW_PRIORITY) |
57 | 56 | public class ImgLabelingTypeExtractor implements TypeExtractor<ImgLabeling<?, ?>> { |
58 | 57 |
|
59 | | - @Parameter |
60 | | - private TypeService typeService; |
61 | | - |
62 | 58 | @Override |
63 | | - public Type reify(final ImgLabeling<?, ?> o, final int n) { |
| 59 | + public Type reify(final TypeReifier t, final ImgLabeling<?, ?> o, final int n) { |
64 | 60 | if (n < 0 || n > 1) throw new IndexOutOfBoundsException(); |
65 | 61 |
|
66 | 62 | if(n == 0) { |
67 | 63 | // o.firstElement will return a LabelingType |
68 | | - Type labelingType = typeService.reify(o.firstElement()); |
| 64 | + Type labelingType = t.reify(o.firstElement()); |
69 | 65 | // sanity check |
70 | 66 | if(!(labelingType instanceof ParameterizedType)) throw new IllegalArgumentException("ImgLabeling is not of a LabelingType"); |
71 | 67 | // get type arg of labelingType |
72 | 68 | ParameterizedType pType = (ParameterizedType) labelingType; |
73 | 69 | return pType.getActualTypeArguments()[0]; |
74 | 70 | } |
75 | 71 | // otherwise n == 1 |
76 | | - return typeService.reify(Views.iterable(o.getSource()).firstElement()); |
| 72 | + return t.reify(Views.iterable(o.getSource()).firstElement()); |
77 | 73 | } |
78 | 74 |
|
79 | 75 | @Override |
|
0 commit comments