File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
main/java/org/janelia/alignment/multisem
test/java/org/janelia/alignment/multisem Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -89,11 +89,11 @@ public static String getMfovSfovForTileId(final String tileId) throws IllegalArg
8989 * @return 01 for w60_magc0399_scan005_m0013_r46_s01
9090 */
9191 public static String getSFOVIndexForTileId (final String tileId ) throws IllegalArgumentException {
92- final int scanIndex = tileId .indexOf ("scan " );
92+ final int scanIndex = tileId .indexOf ("_sc " ); // tileIds can contain _scan005_ or _sc01234_
9393 if ((scanIndex < 0 ) || (tileId .length () < (scanIndex + 21 ))) {
9494 throw new IllegalArgumentException ("SFOV index cannot be derived from tileId " + tileId );
9595 }
96- return tileId .substring (scanIndex + 19 );
96+ return tileId .substring (scanIndex + 20 );
9797 }
9898
9999 /**
Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ public void testTileIdParsers() {
2121 "m0013_s01" , MultiSemUtilities .getMfovSfovForTileId (tileId ));
2222 Assert .assertEquals ("invalid SFOVIndexForTileId" ,
2323 "01" , MultiSemUtilities .getSFOVIndexForTileId (tileId ));
24+
25+ final String manyScanTileId = "w66_magc0000_sc09876_m0005_r65_s16" ;
26+ Assert .assertEquals ("invalid MagcMfov" ,
27+ "0000_m0005" , MultiSemUtilities .getMagcMfovForTileId (manyScanTileId ));
28+ Assert .assertEquals ("invalid MagcMfovSfov" ,
29+ "0000_m0005_s16" , MultiSemUtilities .getMagcMfovSfovForTileId (manyScanTileId ));
30+ Assert .assertEquals ("invalid MfovSfov" ,
31+ "m0005_s16" , MultiSemUtilities .getMfovSfovForTileId (manyScanTileId ));
32+ Assert .assertEquals ("invalid SFOVIndexForTileId" ,
33+ "16" , MultiSemUtilities .getSFOVIndexForTileId (manyScanTileId ));
2434 }
2535
2636}
You can’t perform that action at this time.
0 commit comments