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
ef2d12ac
"...graphical-user-interface/graphical-user-interface.md" did not exist on "7c18407e3a635edc7a7cfcf121d46bd1ae389f04"
Commit
ef2d12ac
authored
5 years ago
by
Vojtech Moravec
Browse files
Options
Downloads
Patches
Plain Diff
Logging difference error.
parent
883b9fb9
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
+32
-12
32 additions, 12 deletions
src/main/java/bdv/server/CellHandler.java
with
32 additions
and
12 deletions
src/main/java/bdv/server/CellHandler.java
+
32
−
12
View file @
ef2d12ac
...
...
@@ -10,6 +10,7 @@ import javax.imageio.ImageIO;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
compression.U16
;
import
compression.quantization.scalar.ScalarQuantizer
;
import
compression.utilities.Utils
;
import
org.eclipse.jetty.server.Request
;
...
...
@@ -169,17 +170,36 @@ public class CellHandler extends ContextHandler {
}
else
if
(
compressionParams
.
renderDifference
())
{
assert
(
quantizer
!=
null
)
:
"Compressor wasn't created"
;
short
[]
compressedData
=
quantizer
.
quantize
(
data
);
int
e1
=
0
,
e2
=
0
,
e3
=
0
,
e4
=
0
,
e5
=
0
;
for
(
int
i
=
0
;
i
<
data
.
length
;
i
++)
{
// final int diff = Math.abs(compressedData[i] - data[i]);
// if (diff > 100) {
// data[i] = 2000;
// } else {
// data[i] = 0;
// }
data
[
i
]
=
(
short
)
(
5
*
Utils
.
u16BitsToShort
(
Math
.
abs
(
compressedData
[
i
]
-
data
[
i
])));
final
int
diff
=
Math
.
abs
(
compressedData
[
i
]
-
data
[
i
]);
if
(
diff
<
100
)
{
data
[
i
]
=
1000
;
++
e1
;
}
else
if
(
diff
<
200
)
{
data
[
i
]
=
2000
;
++
e2
;
}
else
if
(
diff
<
300
)
{
data
[
i
]
=
3000
;
++
e3
;
}
else
if
(
diff
<
400
)
{
data
[
i
]
=
4000
;
++
e4
;
}
else
if
(
diff
<
500
)
{
data
[
i
]
=
5000
;
++
e5
;
}
else
{
data
[
i
]
=
0x0
;
}
// assert (data[i] != 0 || (data[i] == 0 && compressedData[i] == 0)) : "BAD";
// data[i] = (short) (5 * Utils.u16BitsToShort(Math.abs(compressedData[i] - data[i])));
}
LOG
.
info
(
String
.
format
(
"E1: %.2f E2: %.2f E3: %.2f E4: %.2f E5: %.2f"
,
(
float
)
e1
/(
float
)
data
.
length
,
(
float
)
e2
/(
float
)
data
.
length
,
(
float
)
e3
/(
float
)
data
.
length
,
(
float
)
e4
/(
float
)
data
.
length
,
(
float
)
e5
/(
float
)
data
.
length
));
//LOG.warn("Not yet implemented.");
}
...
...
@@ -200,9 +220,9 @@ public class CellHandler extends ContextHandler {
transferedDataSize
+=
buf
.
length
;
LOG
.
info
(
String
.
format
(
"I:%d;T:%d;S:%d;L:%d Total transfered data: [%d KB] [%d MB]"
,
index
,
timepoint
,
setup
,
level
,
(
transferedDataSize
/
1000
),
((
transferedDataSize
/
1000
)
/
1000
)));
//
LOG.info(String.format("I:%d;T:%d;S:%d;L:%d Total transfered data: [%d KB] [%d MB]",
//
index, timepoint, setup, level,
//
(transferedDataSize / 1000), ((transferedDataSize / 1000) / 1000)));
response
.
setContentType
(
"application/octet-stream"
);
response
.
setContentLength
(
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