/** * @throws java.lang.Exception */ @BeforeClass public static void setUpBeforeClass() throws Exception { final File testDir = new File(testDirPath); testDir.mkdirs(); if (!(testDir.exists() && testDir.isDirectory())) throw new IOException("Could not create benchmark directory for HDF5Utils benchmark."); data = new short[64 * 64 * 64]; final ImagePlus imp = new Opener().openURL("https://imagej.nih.gov/ij/images/t1-head-raw.zip"); final ImagePlusImg<UnsignedShortType, ?> img = (ImagePlusImg<UnsignedShortType, ?>)(Object)ImagePlusImgs.from(imp); final Cursor<UnsignedShortType> cursor = Views.flatIterable(Views.interval(img, new long[]{100, 100, 30}, new long[]{163, 163, 93})).cursor(); for (int i = 0; i < data.length; ++i) data[i] = (short)cursor.next().get(); n5 = new N5FSWriter(testDirPath); }
final LinearIntensityMap<FloatType> map = new LinearIntensityMap<FloatType>( (FloatImagePlus)ImagePlusImgs.from(coefficients));