From 98a53810d07341c4cd445e316c9502963d9068c9 Mon Sep 17 00:00:00 2001
From: tpietzsch <tobias.pietzsch@gmail.com>
Date: Tue, 24 Sep 2019 19:12:01 +0200
Subject: [PATCH] Change dataset pattern to "/setup%d/timepoint%d/s%d" (no
 zero-padding)

---
 BDV N5 format.md                          | 12 ++++++------
 src/main/java/bdv/img/n5/BdvN5Format.java |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/BDV N5 format.md b/BDV N5 format.md
index 8a98b463..0ec7a7eb 100644
--- a/BDV N5 format.md	
+++ b/BDV N5 format.md	
@@ -7,9 +7,9 @@ multi-resolution 3D stacks are organized in the following N5 hierarchy:
 
 ```
 \
-├── setup00
+├── setup0
 │   ├── attributes.json {"downsamplingFactors":[[1,1,1],[2,2,2]],"dataType":"uint8"}
-│   ├── timepoint00000
+│   ├── timepoint0
 │   │   ├── s0
 │   │   │   ├── attributes.json {"dataType":"uint8","compression":{"type":"bzip2","blockSize":9},"blockSize":[16,16,16],"dimensions":[400,400,25]}
 │   │   │   ┊
@@ -17,14 +17,14 @@ multi-resolution 3D stacks are organized in the following N5 hierarchy:
 │   │   ├── s1
 │   │   ┊
 │   │
-│   ├── timepoint00001
+│   ├── timepoint1
 │   ┊
 │
-├── setup01
+├── setup1
 ┊
 ```
 
-Each 3D stack is stored as a dataset with path formatted as `/setup%02d/timepoint%05d/s%d`.
+Each 3D stack is stored as a dataset with path formatted as `/setup%d/timepoint%d/s%d`.
 Here, `setup` number is flattened index of channel, angle, tile, illumination, etc.,
 `timepoint` is the index of the time point, and `s` is the scale level of the multi-resolution pyramid.
 
@@ -38,7 +38,7 @@ that specify downsampling scheme and datatype, which are the same for all timepo
 `downsamplingFactors` specifies power-of-two downscaling factors for each scale level (with respect to full resolution `s0`, which always has `[1,1,1]`).
 `dataType` is one of {uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, float64}.
 
-> TODO: Additional metadata (for example identifying `setup03` as channel 3, tile 124, etc.) could be replicated from the XML.
+> TODO: Additional metadata (for example identifying `setup3` as channel 3, tile 124, etc.) could be replicated from the XML.
 The idea would be that parts of a dataset can be used independent of BDV, without the XML.
 We should agree on standard attributes for this.
 
diff --git a/src/main/java/bdv/img/n5/BdvN5Format.java b/src/main/java/bdv/img/n5/BdvN5Format.java
index f4d4d69b..fb2dfb4e 100644
--- a/src/main/java/bdv/img/n5/BdvN5Format.java
+++ b/src/main/java/bdv/img/n5/BdvN5Format.java
@@ -7,16 +7,16 @@ public class BdvN5Format
 
 	public static String getPathName( final int setupId )
 	{
-		return String.format( "setup%02d", setupId );
+		return String.format( "setup%d", setupId );
 	}
 
 	public static String getPathName( final int setupId, final int timepointId )
 	{
-		return String.format( "setup%02d/timepoint%05d", setupId, timepointId );
+		return String.format( "setup%d/timepoint%d", setupId, timepointId );
 	}
 
 	public static String getPathName( final int setupId, final int timepointId, final int level )
 	{
-		return String.format( "setup%02d/timepoint%05d/s%d", setupId, timepointId, level );
+		return String.format( "setup%d/timepoint%d/s%d", setupId, timepointId, level );
 	}
 }
-- 
GitLab