File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -215,19 +215,17 @@ def _assign_axes(
215
215
216
216
# For non-linear scales, use EnumeratedAxis
217
217
try :
218
- EnumeratedAxis = sj .jimport ("net.imagej.axis.EnumeratedAxis" )
218
+ if not linear :
219
+ j_coords = [jc .Double (x ) for x in coords_arr ]
220
+ axes [ax_num ] = jc .EnumeratedAxis (ax_type , sj .to_java (j_coords ))
219
221
except (JException , TypeError ):
220
- EnumeratedAxis = None
221
- # If we can use EnumeratedAxis for a nonlinear scale, then use it
222
- if not linear and EnumeratedAxis :
223
- j_coords = [jc .Double (x ) for x in coords_arr ]
224
- axes [ax_num ] = EnumeratedAxis (ax_type , sj .to_java (j_coords ))
225
- # Otherwise, use DefaultLinearAxis
226
- else :
227
- DefaultLinearAxis = sj .jimport ("net.imagej.axis.DefaultLinearAxis" )
222
+ # We don't have EnumeratedAxis available - use DefaultLinearAxis
223
+ pass
224
+ # For linear scales, use DefaultLinearAxis
225
+ finally :
228
226
scale = coords_arr [1 ] - coords_arr [0 ] if len (coords_arr ) > 1 else 1
229
227
origin = coords_arr [0 ] if len (coords_arr ) > 0 else 0
230
- axes [ax_num ] = DefaultLinearAxis (
228
+ axes [ax_num ] = jc . DefaultLinearAxis (
231
229
ax_type , jc .Double (scale ), jc .Double (origin )
232
230
)
233
231
You can’t perform that action at this time.
0 commit comments