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
15778000
Unverified
Commit
15778000
authored
May 13, 2019
by
Philipp Hanslovsky
Browse files
Options
Downloads
Patches
Plain Diff
Do not cache next interpolation as member
This ensures that next works even when new interpolations are added. Also test it
parent
c9e036b3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pom.xml
+6
-0
6 additions, 0 deletions
pom.xml
src/main/java/bdv/viewer/Interpolation.java
+1
-8
1 addition, 8 deletions
src/main/java/bdv/viewer/Interpolation.java
src/test/java/bdv/viewer/InterpolationTest.java
+15
-0
15 additions, 0 deletions
src/test/java/bdv/viewer/InterpolationTest.java
with
22 additions
and
8 deletions
pom.xml
+
6
−
0
View file @
15778000
...
...
@@ -193,5 +193,11 @@
<artifactId>
scijava-listeners
</artifactId>
<version>
1.0.0-beta-2
</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
This diff is collapsed.
Click to expand it.
src/main/java/bdv/viewer/Interpolation.java
+
1
−
8
View file @
15778000
...
...
@@ -37,15 +37,8 @@ public enum Interpolation
NEARESTNEIGHBOR
(
"nearest-neighbor interpolation"
),
NLINEAR
(
"tri-linear interpolation"
);
static
{
NEARESTNEIGHBOR
.
next
=
NLINEAR
;
NLINEAR
.
next
=
NEARESTNEIGHBOR
;
}
private
final
String
name
;
private
Interpolation
next
=
null
;
private
Interpolation
(
final
String
name
)
{
this
.
name
=
name
;
...
...
@@ -57,6 +50,6 @@ public enum Interpolation
}
public
Interpolation
next
()
{
return
next
;
return
Interpolation
.
values
()[
(
this
.
ordinal
()
+
1
)
%
Interpolation
.
values
().
length
]
;
}
}
This diff is collapsed.
Click to expand it.
src/test/java/bdv/viewer/InterpolationTest.java
0 → 100644
+
15
−
0
View file @
15778000
package
bdv.viewer
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
public
class
InterpolationTest
{
@Test
public
void
next
()
{
Assert
.
assertEquals
(
Interpolation
.
NLINEAR
,
Interpolation
.
NEARESTNEIGHBOR
.
next
()
);
Assert
.
assertEquals
(
Interpolation
.
NEARESTNEIGHBOR
,
Interpolation
.
NLINEAR
.
next
()
);
}
}
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
sign in
to comment