|
56 | 56 | import javax.swing.tree.TreePath; |
57 | 57 | import javax.swing.tree.TreeSelectionModel; |
58 | 58 |
|
| 59 | +import org.janelia.saalfeldlab.n5.N5Exception.N5IOException; |
59 | 60 | import org.janelia.saalfeldlab.n5.bdv.N5ViewerTreeCellRenderer; |
60 | 61 | import org.janelia.saalfeldlab.n5.ij.N5Importer.N5BasePathFun; |
61 | 62 | import org.janelia.saalfeldlab.n5.ij.N5Importer.N5ViewerReaderFun; |
@@ -144,8 +145,6 @@ public class BigWarpInitDialog extends JFrame |
144 | 145 |
|
145 | 146 | private boolean initialRecorderState; |
146 | 147 |
|
147 | | - |
148 | | - |
149 | 148 | public BigWarpInitDialog( final String title ) |
150 | 149 | { |
151 | 150 | this( title, null ); |
@@ -187,32 +186,16 @@ public BigWarpInitDialog( final String title, final DatasetService datasetServic |
187 | 186 | }; |
188 | 187 | } |
189 | 188 |
|
190 | | - public static void main( String[] args ) { |
191 | | - |
192 | | - final ImageJ ij = new ImageJ(); |
193 | | -// runBigWarp( "/home/john/tmp/boats_lm.csv", |
194 | | -// new String[]{ "/home/john/tmp/boats.tif", "/home/john/tmp/boats.tif" }, |
195 | | -// new String[]{ "true", "false" }, |
196 | | -// null); |
197 | | - |
198 | | -// runBigWarp( "/home/john/tmp/boats_lm2.csv", |
199 | | -// new String[]{ "/home/john/tmp/boats.tif", "/home/john/tmp/boats-HR.tif" }, |
200 | | -// new String[]{ "true", "false" }, |
201 | | -// null); |
202 | | - |
203 | | -// runBigWarp( "file:///home/john/Documents/presentations/20231130_BdvCommunity/demo/boats-hr-project.json ", |
204 | | -// null, |
205 | | -// null, |
206 | | -// null); |
207 | | - |
208 | | - new BigWarpInitDialog("bigwarp test").createAndShow(); |
209 | | - } |
210 | | - |
211 | 189 | public void setInitialRecorderState( final boolean initialRecorderState ) |
212 | 190 | { |
213 | 191 | this.initialRecorderState = initialRecorderState; |
214 | 192 | } |
215 | 193 |
|
| 194 | + public static < T extends NativeType<T> > BigWarp<?> runBigWarp( final String projectLandmarkPath) |
| 195 | + { |
| 196 | + return runBigWarp( projectLandmarkPath, null, null, null ); |
| 197 | + } |
| 198 | + |
216 | 199 | public static < T extends NativeType<T> > BigWarp<?> runBigWarp( final String projectLandmarkPath, final String[] images, final String[] moving, final String[] transforms ) |
217 | 200 | { |
218 | 201 | final String projectLandmarkPathTrim = projectLandmarkPath == null ? null : projectLandmarkPath.trim(); |
@@ -617,11 +600,18 @@ public JPanel createContent() |
617 | 600 | clist.insets = new Insets(OUTER_PAD, BUTTON_PAD, MID_PAD, BUTTON_PAD); |
618 | 601 |
|
619 | 602 | sourceTableModel = new BigWarpSourceTableModel( t -> { |
620 | | - final String val = NgffTransformations.detectTransforms(t); |
621 | | - if (val != null) |
622 | | - showMessage(1000, "Found transformation"); |
| 603 | + try { |
| 604 | + final String val = NgffTransformations.detectTransforms(t); |
| 605 | + if( val == null ) |
| 606 | + showMessage(1000, "No transformation found"); |
| 607 | + else |
| 608 | + showMessage(1000, "Found transformation"); |
623 | 609 |
|
624 | | - return val; |
| 610 | + return val; |
| 611 | + } catch( N5IOException e ) { |
| 612 | + System.err.println(e.getLocalizedMessage()); |
| 613 | + } |
| 614 | + return null; |
625 | 615 | }); |
626 | 616 |
|
627 | 617 | final BigWarpSourceListPanel srcListPanel = new BigWarpSourceListPanel( sourceTableModel ); |
|
0 commit comments