Skip to content

Commit c907e95

Browse files
authored
Merge pull request #13 from qupath/imglib2-image-server
Imglib2 image server
2 parents 271dd49 + 7d9ccb0 commit c907e95

File tree

6 files changed

+2238
-6
lines changed

6 files changed

+2238
-6
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Here is a sample script that shows how to use the library from QuPath:
88

99
```groovy
1010
import qupath.ext.imglib2.ImgCreator
11-
import qupath.ext.imglib2.Dimension
11+
import qupath.ext.imglib2.ImgLib2ImageServer
1212
import net.imglib2.type.numeric.ARGBType
1313
1414
@@ -45,10 +45,15 @@ println safeImg
4545
// For example, to read the pixel located at [x:1, y:2; c:0; z:0; t:0]:
4646
var randomAccess = randomAccessible.randomAccess()
4747
48-
var position = new long[Dimension.values().length]
49-
position[ImgCreator.getIndexOfDimension(Dimension.X)] = 1
50-
position[ImgCreator.getIndexOfDimension(Dimension.Y)] = 2
48+
var position = new long[ImgCreator.NUMBER_OF_AXES]
49+
position[ImgCreator.AXIS_X] = 1
50+
position[ImgCreator.AXIS_Y] = 2
5151
5252
var pixel = randomAccess.setPositionAndGet(position)
5353
println pixel
54+
55+
56+
// It is also possible to create an ImageServer from a RandomAccessible or Img.
57+
var newServer = ImgLib2ImageServer.builder(List.of(randomAccessible)).build()
58+
println newServer
5459
```

0 commit comments

Comments
 (0)