Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Server_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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioinformaticDataCompression
BigDataViewer_Server_Extension
Commits
ef5dabdc
Commit
ef5dabdc
authored
5 years ago
by
Vojtech Moravec
Browse files
Options
Downloads
Patches
Plain Diff
Dump HDF5 chunks.
parent
feb6f025
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/bdv/server/CellHandler.java
+17
-9
17 additions, 9 deletions
src/main/java/bdv/server/CellHandler.java
with
17 additions
and
9 deletions
src/main/java/bdv/server/CellHandler.java
+
17
−
9
View file @
ef5dabdc
...
...
@@ -2,6 +2,7 @@ package bdv.server;
import
java.awt.image.BufferedImage
;
import
java.io.*
;
import
java.nio.ByteBuffer
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
...
...
@@ -12,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import
compression.U16
;
import
compression.data.Chunk3D
;
import
compression.data.ChunkIO
;
import
compression.data.V3i
;
import
compression.data.V3l
;
import
compression.quantization.scalar.ScalarQuantizer
;
...
...
@@ -165,18 +167,19 @@ public class CellHandler extends ContextHandler {
cell
=
cache
.
getLoadingVolatileCache
().
get
(
key
,
cacheHints
,
new
VolatileCellLoader
<>(
loader
,
timepoint
,
setup
,
level
,
cellDims
,
cellMin
));
}
@SuppressWarnings
(
"unchecked"
)
short
[]
data
=
((
VolatileCell
<
VolatileShortArray
>)
cell
).
getData
().
getCurrentStorageArray
();
Chunk3D
boxChunk
=
new
Chunk3D
(
new
V3i
(
cellDims
[
0
],
cellDims
[
1
],
cellDims
[
2
]),
data
);
boxChunk
.
setOffsets
(
cellMin
[
0
],
cellMin
[
1
],
cellMin
[
2
]);
//System.out.println(boxChunk.toString());
// TODO(Moravec): When chunking boxes of non-uniform dimensions, some data cells are missed!
if
(
cellDims
[
0
]
!=
16
||
cellDims
[
1
]
!=
16
||
cellDims
[
2
]
!=
16
)
{
boxChunk
.
divideIntoChunks
(
new
V3i
(
2
,
2
,
2
));
}
//boxChunk.divideIntoChunks(new V3i(3,3,3));
// // Stupidity just testing chunking
// {
// Chunk3D dataBox = new Chunk3D(new V3i(cellDims[0], cellDims[1], cellDims[2]),
// new V3l(cellMin[0], cellMin[1], cellMin[1]), data);
// Chunk3D[] chunks = dataBox.divideIntoChunks(new V3i(3));
// dataBox.zeroData();
// dataBox.reconstructFromChunks(chunks);
// data = dataBox.getDataAsShort();
// }
if
(
compressionParams
.
shouldCompressData
())
{
assert
(
quantizer
!=
null
)
:
"Compressor wasn't created"
;
...
...
@@ -229,10 +232,15 @@ public class CellHandler extends ContextHandler {
}
if
(
compressionParams
.
shouldDumpRequestData
())
{
// Normal data dump
/*
FileOutputStream dumpStream = new FileOutputStream(compressionParams.getDumpFile(), true);
dumpStream.write(buf);
dumpStream.flush();
dumpStream.close();
*/
// Dumping HDF5 3D chunks
ChunkIO
.
saveChunks
(
cellDims
,
cellMin
,
buf
,
compressionParams
.
getDumpFile
());
}
transferedDataSize
+=
buf
.
length
;
...
...
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