|
84 | 84 | import bigwarp.transforms.metadata.N5TransformMetadataParser; |
85 | 85 | import bigwarp.transforms.metadata.N5TransformTreeCellRenderer; |
86 | 86 | import ij.IJ; |
87 | | -import ij.ImageJ; |
88 | 87 | import ij.ImagePlus; |
89 | 88 | import ij.Macro; |
90 | 89 | import ij.Prefs; |
@@ -157,7 +156,7 @@ public BigWarpInitDialog( final String title, final DatasetService datasetServic |
157 | 156 | initialPath = ""; |
158 | 157 | imageJOpen = IJ.getInstance() != null; |
159 | 158 |
|
160 | | - buildN5SelectionDialog(); |
| 159 | + exec = Executors.newFixedThreadPool( Prefs.getThreads() ); |
161 | 160 | final Container content = getContentPane(); |
162 | 161 | content.add( createContent() ); |
163 | 162 | pack(); |
@@ -325,11 +324,12 @@ else if( tableRow.type.equals( SourceType.DATASET )) |
325 | 324 | BigWarpInit.add( data, infos, tableRow.getTransform(), tableRow.getTransformUri() ); |
326 | 325 | id += infos.size(); |
327 | 326 | } |
328 | | - else |
| 327 | + else // URI |
329 | 328 | { |
330 | 329 | // deal with exceptions differently? |
331 | 330 | try |
332 | 331 | { |
| 332 | + final N5Metadata metadata = sourceTableModel.getMetadata(i); |
333 | 333 | final LinkedHashMap< Source< T >, SourceInfo > infos = BigWarpInit.createSources( data, tableRow.srcName, id, tableRow.moving ); |
334 | 334 | BigWarpInit.add( data, infos, tableRow.getTransform(), tableRow.getTransformUri() ); |
335 | 335 | id += infos.size(); |
@@ -466,7 +466,6 @@ public JPanel createContent() |
466 | 466 | containerPathText = new JTextField(); |
467 | 467 | containerPathText.setText( initialPath ); |
468 | 468 | containerPathText.setPreferredSize( new Dimension( frameSizeX / 3, containerPathText.getPreferredSize().height ) ); |
469 | | -// containerPathText.addActionListener( e -> openContainer( n5Fun, () -> getN5RootPath(), pathFun ) ); |
470 | 469 | panel.add(containerPathText, gbcBar); |
471 | 470 |
|
472 | 471 | cadd.gridy = 2; |
@@ -497,7 +496,7 @@ public JPanel createContent() |
497 | 496 |
|
498 | 497 | addN5Button.addActionListener( e -> { |
499 | 498 |
|
500 | | - selectionDialog = new DatasetSelectorDialog( new N5ViewerReaderFun(), new N5BasePathFun(), |
| 499 | + selectionDialog = new DatasetSelectorDialog( new BigWarpInit.BigWarpN5ReaderFun(), new N5BasePathFun(), |
501 | 500 | lastOpenedContainer, |
502 | 501 | BigWarpInit.GROUP_PARSERS, |
503 | 502 | BigWarpInit.PARSERS); |
@@ -660,59 +659,22 @@ public JPanel createContent() |
660 | 659 | return panel; |
661 | 660 | } |
662 | 661 |
|
| 662 | + /** |
| 663 | + * This method is a no-op. |
| 664 | + * |
| 665 | + * @deprecated |
| 666 | + */ |
| 667 | + @Deprecated |
663 | 668 | public void buildN5SelectionDialog() |
664 | 669 | { |
665 | | - exec = Executors.newFixedThreadPool( Prefs.getThreads() ); |
666 | | - |
667 | | - |
668 | | - /* |
669 | | - * The Dialogs need to be created anew by the action listener |
670 | | - */ |
671 | | - |
672 | | -// selectionDialog = new DatasetSelectorDialog( new N5ViewerReaderFun(), new N5BasePathFun(), |
673 | | -// lastOpenedContainer, |
674 | | -// n5vGroupParsers, |
675 | | -// n5Parsers); |
676 | | -// |
677 | | -// selectionDialog.setLoaderExecutor( exec ); |
678 | | -// selectionDialog.setTreeRenderer(new N5ViewerTreeCellRenderer(false)); |
679 | | -// |
680 | | -// selectionDialog.setContainerPathUpdateCallback( x -> { |
681 | | -// if ( x != null ) |
682 | | -// lastOpenedContainer = x; |
683 | | -// } ); |
684 | | -// |
685 | | -// // figure this out |
686 | | -//// selectionDialog.setCancelCallback( x -> { |
687 | | -//// // set back recorder state if canceled |
688 | | -//// Recorder.record = initialRecorderState; |
689 | | -//// } ); |
690 | | -// |
691 | | -// selectionDialog.setVirtualOption( false ); |
692 | | -// selectionDialog.setCropOption( false ); |
693 | | - |
694 | | - |
695 | | -// // transform |
696 | | -// |
697 | | -// final N5MetadataParser<?>[] tformParsers = new N5MetadataParser<?>[]{ new N5TransformMetadataParser() }; |
698 | | -// |
699 | | -// transformSelectionDialog = new DatasetSelectorDialog( new N5ViewerReaderFun(), new N5BasePathFun(), |
700 | | -// lastOpenedContainer, new N5MetadataParser[] {}, tformParsers ); |
701 | | -// |
702 | | -// transformSelectionDialog.setLoaderExecutor( exec ); |
703 | | -// transformSelectionDialog.setTreeRenderer( new N5TransformTreeCellRenderer( true ) ); |
704 | | -// transformSelectionDialog.setContainerPathUpdateCallback( x -> { |
705 | | -// if ( x != null ) |
706 | | -// lastOpenedContainer = x; |
707 | | -// } ); |
708 | | - |
| 670 | + // NoOp |
709 | 671 | } |
710 | 672 |
|
711 | 673 | public void n5DialogCallback( final DataSelection selection ) |
712 | 674 | { |
713 | 675 | final String n5RootPath = selectionDialog.getN5RootPath(); |
714 | | - for( final N5Metadata m : selection.metadata ) |
715 | | - sourceTableModel.add( n5RootPath + "?" + m.getPath() ); |
| 676 | + for (final N5Metadata m : selection.metadata) |
| 677 | + sourceTableModel.add(n5RootPath + "?" + m.getPath(), m); |
716 | 678 |
|
717 | 679 | repaint(); |
718 | 680 | } |
@@ -948,7 +910,7 @@ private String browseTransformDialog() |
948 | 910 | return s; |
949 | 911 | } |
950 | 912 |
|
951 | | - public void setParameters( final String projectLandmarkPath, final String images, final String moving, final String transforms ) { |
| 913 | + public void setParameters( final String projectLaBigWarpInitDialogndmarkPath, final String images, final String moving, final String transforms ) { |
952 | 914 | this.projectLandmarkPath = projectLandmarkPath; |
953 | 915 | this.imageList = images; |
954 | 916 | this.movingList = moving; |
|
0 commit comments