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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioinformaticDataCompression
BigDataViewer_Core_Extension
Commits
4141e294
Commit
4141e294
authored
6 years ago
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
Expose utility methods for Source creation and add javadoc
parent
75e082a6
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/BigDataViewer.java
+34
-8
34 additions, 8 deletions
src/main/java/bdv/BigDataViewer.java
with
34 additions
and
8 deletions
src/main/java/bdv/BigDataViewer.java
+
34
−
8
View file @
4141e294
...
...
@@ -166,8 +166,19 @@ public class BigDataViewer
return
name
;
}
/**
* Create standard converter from the given {@code type} to ARGB:
* <ul>
* <li>For {@code RealType}s a {@link RealARGBColorConverter} is
* returned.</li>
* <li>For {@code ARGBType}s a {@link ScaledARGBConverter.ARGB} is
* returned.</li>
* <li>For {@code VolatileARGBType}s a
* {@link ScaledARGBConverter.VolatileARGB} is returned.</li>
* </ul>
*/
@SuppressWarnings
(
"unchecked"
)
p
rivate
static
<
T
>
Converter
<
T
,
ARGBType
>
createConverter
(
final
T
type
)
p
ublic
static
<
T
extends
NumericType
<
T
>
>
Converter
<
T
,
ARGBType
>
createConverter
ToARGB
(
final
T
type
)
{
if
(
type
instanceof
RealType
)
{
...
...
@@ -184,7 +195,21 @@ public class BigDataViewer
throw
new
IllegalArgumentException
(
"ImgLoader of type "
+
type
.
getClass
()
+
" not supported."
);
}
private
static
ConverterSetup
createConverterSetup
(
final
SourceAndConverter
<
?
>
soc
,
final
int
setupId
)
/**
* Create a {@code ConverterSetup} for the given {@code SourceAndConverter}.
* {@link SourceAndConverter#asVolatile() Nested volatile}
* {@code SourceAndConverter} are added to the {@code ConverterSetup} if
* present. If {@code SourceAndConverter} does not comprise a
* {@code ColorConverter}, returns {@code null}.
*
* @param soc
* {@code SourceAndConverter} for which to create a
* {@code ConverterSetup}
* @param setupId
* setupId of the created {@code ConverterSetup}
* @return a new {@code ConverterSetup} or {@code null}
*/
public
static
ConverterSetup
createConverterSetup
(
final
SourceAndConverter
<
?
>
soc
,
final
int
setupId
)
{
final
List
<
ColorConverter
>
converters
=
new
ArrayList
<>();
...
...
@@ -208,9 +233,10 @@ public class BigDataViewer
/**
* Decorate source with an extra transformation, that can be edited manually
* in this viewer.
* in this viewer. {@link SourceAndConverter#asVolatile() Nested volatile}
* {@code SourceAndConverter} are wrapped as well, if present.
*/
p
rivate
static
<
T
,
V
extends
Volatile
<
T
>
>
SourceAndConverter
<
T
>
wrapWithTransformedSource
(
final
SourceAndConverter
<
T
>
soc
)
p
ublic
static
<
T
,
V
extends
Volatile
<
T
>
>
SourceAndConverter
<
T
>
wrapWithTransformedSource
(
final
SourceAndConverter
<
T
>
soc
)
{
if
(
soc
.
asVolatile
()
==
null
)
return
new
SourceAndConverter
<>(
new
TransformedSource
<>(
soc
.
getSpimSource
()
),
soc
.
getConverter
()
);
...
...
@@ -244,11 +270,11 @@ public class BigDataViewer
if
(
volatileType
!=
null
)
{
final
VolatileSpimSource
<
V
>
vs
=
new
VolatileSpimSource
<>(
spimData
,
setupId
,
setupName
);
vsoc
=
new
SourceAndConverter
<>(
vs
,
createConverter
(
volatileType
)
);
vsoc
=
new
SourceAndConverter
<>(
vs
,
createConverter
ToARGB
(
volatileType
)
);
}
final
SpimSource
<
T
>
s
=
new
SpimSource
<>(
spimData
,
setupId
,
setupName
);
final
SourceAndConverter
<
T
>
soc
=
new
SourceAndConverter
<>(
s
,
createConverter
(
type
),
vsoc
);
final
SourceAndConverter
<
T
>
soc
=
new
SourceAndConverter
<>(
s
,
createConverter
ToARGB
(
type
),
vsoc
);
final
SourceAndConverter
<
T
>
tsoc
=
wrapWithTransformedSource
(
soc
);
sources
.
add
(
tsoc
);
...
...
@@ -663,7 +689,7 @@ public class BigDataViewer
// final String fn = "/Users/Pietzsch/Desktop/bdv example/drosophila 2.xml";
// final String fn = "/Users/pietzsch/Desktop/data/clusterValia/140219-1/valia-140219-1.xml";
// final String fn = "/Users/Pietzsch/Desktop/data/catmaid.xml";
final
String
fn
=
"src/main/resources/openconnectome-bock11-neariso.xml"
;
//
final String fn = "src/main/resources/openconnectome-bock11-neariso.xml";
// final String fn = "/home/saalfeld/catmaid.xml";
// final String fn = "/home/saalfeld/catmaid-fafb00-v9.xml";
// final String fn = "/home/saalfeld/catmaid-fafb00-sample_A_cutout_3k.xml";
...
...
@@ -679,7 +705,7 @@ public class BigDataViewer
// final String fn = "/Users/pietzsch/Desktop/data/fibsem-remote.xml";
// final String fn = "/Users/pietzsch/Desktop/url-valia.xml";
// final String fn = "/Users/pietzsch/Desktop/data/clusterValia/140219-1/valia-140219-1.xml";
//
final String fn = "/Users/pietzsch/workspace/data/111010_weber_full.xml";
final
String
fn
=
"/Users/pietzsch/workspace/data/111010_weber_full.xml"
;
// final String fn = "/Volumes/projects/tomancak_lightsheet/Mette/ZeissZ1SPIM/Maritigrella/021013_McH2BsGFP_CAAX-mCherry/11-use/hdf5/021013_McH2BsGFP_CAAX-mCherry-11-use.xml";
try
{
...
...
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