Skip to content

Commit

Permalink
Merge pull request #143 from henrypinkard/main
Browse files Browse the repository at this point in the history
Fix bug that allowed low resolutions on non multi-res datasets
  • Loading branch information
henrypinkard authored Jun 6, 2024
2 parents 18fc782 + 610d9b4 commit 01a8eb8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
21 changes: 14 additions & 7 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.micro-manager.ndtiffstorage</groupId>
<artifactId>NDTiffStorage</artifactId>
<version>2.16.0</version>
<version>2.16.1</version>
<packaging>jar</packaging>
<name>NDTiff Storage file format</name>
<description>Java-based writer and reader used for NDTiffStorage format</description>
Expand Down Expand Up @@ -104,17 +104,24 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<dependencies>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.15</version> <!-- apparently this needs to be exactly this version -->
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ private void populateNewResolutionLevel(int resolutionIndex, boolean addToLowRes
*/
@Override
public void increaseMaxResolutionLevel(int newMaxResolutionLevel) {
if (!tiled_) {
return; // only tiled images support multiple resolutions
}
int oldMaxResolutionLevel = maxResolutionLevel_;
maxResolutionLevel_ = Math.max(newMaxResolutionLevel, oldMaxResolutionLevel);
if (fullResStorage_.imageKeys().size() == 0) {
Expand Down
6 changes: 5 additions & 1 deletion python/ndtiff/nd_tiff_current.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def __enter__(self):

def __exit__(self, exc_type, exc_val, exc_tb):
self.close()

def get_channel_names(self):
"""
:return: list of channel names (strings)
Expand Down Expand Up @@ -567,7 +567,11 @@ def _read_single_index_entry(self, data, entries, position=0):
entries[frozenset(axes.items())] = index_entry
return position, axes, index_entry

#TODO: make private
def read_index(self, path):
"""
Do not use directly -- this function will be made private in the future
"""
print("\rReading index... ", end="")
with self.file_io.open(path + "NDTiff.index", "rb") as index_file:
data = index_file.read()
Expand Down

0 comments on commit 01a8eb8

Please sign in to comment.