Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Fiji_Plugin
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_Fiji_Plugin
Commits
ffc9dd28
Commit
ffc9dd28
authored
10 years ago
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
document and clean up LoopbackHeuristic
parent
de09fcb6
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/ij/ExportImagePlusPlugIn.java
+11
-20
11 additions, 20 deletions
src/main/java/bdv/ij/ExportImagePlusPlugIn.java
with
11 additions
and
20 deletions
src/main/java/bdv/ij/ExportImagePlusPlugIn.java
+
11
−
20
View file @
ffc9dd28
...
...
@@ -157,7 +157,13 @@ public class ExportImagePlusPlugIn implements PlugIn
for
(
final
BasicViewSetup
setup
:
seq
.
getViewSetupsOrdered
()
)
perSetupExportMipmapInfo
.
put
(
setup
.
getId
(),
mipmapInfo
);
// TODO: explain & test
// LoopBackHeuristic:
// - If saving more than 8x on pixel reads use the loopback image over
// original image
// - For virtual stacks also consider the cache size that would be
// required for all original planes contributing to a "plane of
// blocks" at the current level. If this is more than 1/4 of
// available memory, use the loopback image.
final
boolean
isVirtual
=
imp
.
getStack
().
isVirtual
();
final
long
planeSizeInBytes
=
imp
.
getWidth
()
*
imp
.
getHeight
()
*
imp
.
getBytesPerPixel
();
final
long
ijMaxMemory
=
IJ
.
maxMemory
();
...
...
@@ -169,20 +175,13 @@ public class ExportImagePlusPlugIn implements PlugIn
if
(
previousLevel
<
0
)
return
false
;
if
(
WriteSequenceToHdf5
.
numElements
(
factorsToOriginalImg
)
/
WriteSequenceToHdf5
.
numElements
(
factorsToPreviousLevel
)
>=
8
)
return
true
;
if
(
isVirtual
)
{
final
long
requiredCacheSize
=
planeSizeInBytes
*
factorsToOriginalImg
[
2
]
*
chunkSize
[
2
];
System
.
out
.
println
(
"requiredCacheSize = "
+
planeSizeInBytes
+
" * "
+
factorsToOriginalImg
[
2
]
+
" * "
+
chunkSize
[
2
]
+
" = "
+
requiredCacheSize
);
System
.
out
.
println
(
"ijMaxMemory = "
+
ijMaxMemory
);
if
(
requiredCacheSize
>
ijMaxMemory
/
3
)
{
System
.
out
.
println
(
"--> use loopback"
);
return
true
;
}
}
else
{
if
(
WriteSequenceToHdf5
.
numElements
(
factorsToOriginalImg
)
/
WriteSequenceToHdf5
.
numElements
(
factorsToPreviousLevel
)
>=
8
)
if
(
requiredCacheSize
>
ijMaxMemory
/
4
)
return
true
;
}
...
...
@@ -199,16 +198,8 @@ public class ExportImagePlusPlugIn implements PlugIn
final
long
max
=
Runtime
.
getRuntime
().
maxMemory
();
final
long
actuallyFree
=
max
-
total
+
free
;
System
.
out
.
println
(
"freeMemory = "
+
(
free
/
1024
/
1024
)
+
"MB"
);
System
.
out
.
println
(
"freeMemory (corrected) = "
+
(
actuallyFree
/
1024
/
1024
)
+
"MB"
);
System
.
out
.
println
(
"totalMemory = "
+
(
total
/
1024
/
1024
)
+
"MB"
);
System
.
out
.
println
(
"maxMemory = "
+
(
max
/
1024
/
1024
)
+
"MB"
);
if
(
actuallyFree
<
max
/
2
)
{
System
.
out
.
println
(
"clearCache"
);
imgLoader
.
clearCache
();
}
}
}
};
...
...
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