Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Core_Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioinformaticDataCompression
BigDataViewer_Core_Extension
Commits
f8b856f9
Commit
f8b856f9
authored
Jan 14, 2016
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
fix compile errors
parent
287c263a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/bdv/cl/JoclExample.java
+19
-18
19 additions, 18 deletions
src/main/java/bdv/cl/JoclExample.java
src/main/java/bdv/cl/RenderSlice.java
+27
-25
27 additions, 25 deletions
src/main/java/bdv/cl/RenderSlice.java
with
46 additions
and
43 deletions
src/main/java/bdv/cl/JoclExample.java
+
19
−
18
View file @
f8b856f9
package
bdv.cl
;
import
ij.ImageJ
;
import
java.io.IOException
;
import
java.nio.ByteBuffer
;
import
java.nio.IntBuffer
;
import
java.nio.ShortBuffer
;
import
java.util.Random
;
import
mpicbg.spim.data.SpimDataException
;
import
net.imglib2.img.array.ArrayImgs
;
import
net.imglib2.img.basictypeaccess.volatiles.array.VolatileShortArray
;
import
net.imglib2.img.display.imagej.ImageJFunctions
;
import
net.imglib2.util.IntervalIndexer
;
import
bdv.img.cache.CacheHints
;
import
bdv.img.cache.LoadingStrategy
;
import
bdv.img.cache.VolatileCell
;
import
bdv.img.cache.VolatileGlobalCellCache
;
import
bdv.img.hdf5.Hdf5ImageLoader
;
import
bdv.spimdata.SequenceDescriptionMinimal
;
import
bdv.spimdata.SpimDataMinimal
;
import
bdv.spimdata.XmlIoSpimDataMinimal
;
import
com.jogamp.common.nio.Buffers
;
import
com.jogamp.opencl.CLBuffer
;
import
com.jogamp.opencl.CLCommandQueue
;
...
...
@@ -37,6 +21,22 @@ import com.jogamp.opencl.CLMemory.Map;
import
com.jogamp.opencl.CLMemory.Mem
;
import
com.jogamp.opencl.CLProgram
;
import
bdv.img.cache.CacheHints
;
import
bdv.img.cache.LoadingStrategy
;
import
bdv.img.cache.VolatileCell
;
import
bdv.img.cache.VolatileGlobalCellCache
;
import
bdv.img.hdf5.Hdf5ImageLoader
;
import
bdv.img.hdf5.Hdf5VolatileShortArrayLoader
;
import
bdv.spimdata.SequenceDescriptionMinimal
;
import
bdv.spimdata.SpimDataMinimal
;
import
bdv.spimdata.XmlIoSpimDataMinimal
;
import
ij.ImageJ
;
import
mpicbg.spim.data.SpimDataException
;
import
net.imglib2.img.array.ArrayImgs
;
import
net.imglib2.img.basictypeaccess.volatiles.array.VolatileShortArray
;
import
net.imglib2.img.display.imagej.ImageJFunctions
;
import
net.imglib2.util.IntervalIndexer
;
public
class
JoclExample
{
private
final
String
fn
=
"/Users/pietzsch/workspace/data/111010_weber_full.xml"
;
...
...
@@ -117,10 +117,11 @@ public class JoclExample
final
SpimDataMinimal
spimData
=
io
.
load
(
fn
);
final
SequenceDescriptionMinimal
seq
=
spimData
.
getSequenceDescription
();
final
Hdf5ImageLoader
imgLoader
=
(
Hdf5ImageLoader
)
seq
.
getImgLoader
();
final
Hdf5VolatileShortArrayLoader
loader
=
imgLoader
.
getShortArrayLoader
();
final
VolatileGlobalCellCache
<
VolatileShortArray
>
cache
=
imgLoader
.
getCache
();
final
VolatileGlobalCellCache
cache
=
imgLoader
.
getCache
();
final
CacheHints
cacheHints
=
new
CacheHints
(
LoadingStrategy
.
BLOCKING
,
0
,
false
);
final
VolatileGlobalCellCache
<
VolatileShortArray
>
.
VolatileCellCache
cellCache
=
cache
.
new
VolatileCellCache
(
0
,
0
,
0
,
cacheHints
);
final
VolatileGlobalCellCache
.
VolatileCellCache
<
VolatileShortArray
>
cellCache
=
cache
.
new
VolatileCellCache
<
VolatileShortArray
>
(
1
,
0
,
0
,
cacheHints
,
loader
);
final
int
n
=
3
;
final
int
[]
dim
=
new
int
[]
{
15
,
7
,
3
};
...
...
This diff is collapsed.
Click to expand it.
src/main/java/bdv/cl/RenderSlice.java
+
27
−
25
View file @
f8b856f9
...
...
@@ -11,28 +11,6 @@ import java.nio.ShortBuffer;
import
javax.swing.JFrame
;
import
mpicbg.spim.data.sequence.ViewId
;
import
net.imglib2.Cursor
;
import
net.imglib2.RandomAccessible
;
import
net.imglib2.display.screenimage.awt.UnsignedByteAWTScreenImage
;
import
net.imglib2.img.array.ArrayImgs
;
import
net.imglib2.realtransform.AffineTransform2D
;
import
net.imglib2.realtransform.AffineTransform3D
;
import
net.imglib2.type.numeric.integer.UnsignedShortType
;
import
net.imglib2.ui.InteractiveDisplayCanvasComponent
;
import
net.imglib2.ui.overlay.BufferedImageOverlayRenderer
;
import
net.imglib2.ui.util.GuiUtil
;
import
net.imglib2.util.IntervalIndexer
;
import
net.imglib2.util.Intervals
;
import
net.imglib2.view.Views
;
import
bdv.cl.BlockTexture.Block
;
import
bdv.cl.BlockTexture.BlockKey
;
import
bdv.cl.FindRequiredBlocks.RequiredBlocks
;
import
bdv.img.cache.CachedCellImg
;
import
bdv.img.hdf5.Hdf5ImageLoader
;
import
bdv.viewer.Source
;
import
bdv.viewer.state.ViewerState
;
import
com.jogamp.common.nio.Buffers
;
import
com.jogamp.opencl.CLBuffer
;
import
com.jogamp.opencl.CLCommandQueue
;
...
...
@@ -51,6 +29,28 @@ import com.jogamp.opencl.CLMemory.Map;
import
com.jogamp.opencl.CLMemory.Mem
;
import
com.jogamp.opencl.CLProgram
;
import
bdv.cl.BlockTexture.Block
;
import
bdv.cl.BlockTexture.BlockKey
;
import
bdv.cl.FindRequiredBlocks.RequiredBlocks
;
import
bdv.img.cache.CachedCellImg
;
import
bdv.img.hdf5.Hdf5ImageLoader
;
import
bdv.viewer.Source
;
import
bdv.viewer.state.ViewerState
;
import
mpicbg.spim.data.sequence.ViewId
;
import
net.imglib2.Cursor
;
import
net.imglib2.RandomAccessible
;
import
net.imglib2.display.screenimage.awt.UnsignedByteAWTScreenImage
;
import
net.imglib2.img.array.ArrayImgs
;
import
net.imglib2.realtransform.AffineTransform2D
;
import
net.imglib2.realtransform.AffineTransform3D
;
import
net.imglib2.type.numeric.integer.UnsignedShortType
;
import
net.imglib2.ui.InteractiveDisplayCanvasComponent
;
import
net.imglib2.ui.overlay.BufferedImageOverlayRenderer
;
import
net.imglib2.ui.util.GuiUtil
;
import
net.imglib2.util.IntervalIndexer
;
import
net.imglib2.util.Intervals
;
import
net.imglib2.view.Views
;
public
class
RenderSlice
{
private
final
Hdf5ImageLoader
imgLoader
;
...
...
@@ -147,7 +147,8 @@ public class RenderSlice
t
=
System
.
currentTimeMillis
()
-
t
;
System
.
out
.
println
(
"getRequiredBlocks: "
+
t
+
" ms"
);
t
=
System
.
currentTimeMillis
();
final
RandomAccessible
<
UnsignedShortType
>
img
=
Views
.
extendZero
(
imgLoader
.
getImage
(
new
ViewId
(
timepointId
,
setupId
),
0
)
);
// TODO
final
RandomAccessible
<
UnsignedShortType
>
img
=
Views
.
extendZero
(
imgLoader
.
getSetupImgLoader
(
setupId
).
getImage
(
timepointId
,
0
)
);
// TODO
final
short
[]
blockData
=
new
short
[
paddedBlockSize
[
0
]
*
paddedBlockSize
[
1
]
*
paddedBlockSize
[
2
]
];
int
nnn
=
0
;
for
(
final
int
[]
cellPos
:
requiredBlocks
.
cellPositions
)
...
...
@@ -193,7 +194,7 @@ public class RenderSlice
///////////////////
final
CLImage2d
<
ByteBuffer
>
renderTarget
=
(
CLImage2d
<
ByteBuffer
>
)
cl
.
createImage2d
(
final
CLImage2d
<
ByteBuffer
>
renderTarget
=
cl
.
createImage2d
(
Buffers
.
newDirectByteBuffer
(
width
*
height
),
width
,
height
,
...
...
@@ -315,7 +316,8 @@ public class RenderSlice
private
RequiredBlocks
getRequiredBlocks
(
final
AffineTransform3D
sourceToScreen
,
final
int
w
,
final
int
h
,
final
int
dd
,
final
ViewId
view
)
{
final
CachedCellImg
<
?,
?
>
cellImg
=
(
bdv
.
img
.
cache
.
CachedCellImg
<
?,
?
>
)
imgLoader
.
getImage
(
view
,
0
);
final
RandomAccessible
<
UnsignedShortType
>
img
=
imgLoader
.
getSetupImgLoader
(
view
.
getViewSetupId
()
).
getImage
(
view
.
getTimePointId
(),
0
);
final
CachedCellImg
<
?,
?
>
cellImg
=
(
bdv
.
img
.
cache
.
CachedCellImg
<
?,
?
>
)
img
;
final
long
[]
imgDimensions
=
new
long
[
3
];
cellImg
.
dimensions
(
imgDimensions
);
return
FindRequiredBlocks
.
getRequiredBlocks
(
sourceToScreen
,
w
,
h
,
dd
,
blockSize
,
imgDimensions
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment