From b57bf41c364b3b404669b86d59ed3ef3e3d9beea Mon Sep 17 00:00:00 2001 From: mhdominguez Date: Sat, 2 Mar 2024 20:54:05 -0500 Subject: [PATCH 1/2] modified: pom.xml modified: src/main/java/org/janelia/simview/klb/bdv/KlbImgLoader.java modified: src/main/java/org/janelia/simview/klb/bdv/KlbVolatileArrayLoader.java --- pom.xml | 20 +++++++++++++++---- .../janelia/simview/klb/bdv/KlbImgLoader.java | 3 ++- .../klb/bdv/KlbVolatileArrayLoader.java | 3 ++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index a3e5135..68de889 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,8 @@ org.scijava pom-scijava - 28.0.0 + 37.0.0 + org.janelia.simview @@ -89,6 +90,7 @@ -Xdoclint:none 0.3.6 + 10.4.12 @@ -112,10 +114,20 @@ sc.fiji SPIM_Registration + + + + + net.imglib2 + imglib2-cache + + + net.imglib2 + imglib2 + - com.miglayout - miglayout - swing + net.imglib2 + imglib2-ij diff --git a/src/main/java/org/janelia/simview/klb/bdv/KlbImgLoader.java b/src/main/java/org/janelia/simview/klb/bdv/KlbImgLoader.java index 4593e68..4c0d7f5 100644 --- a/src/main/java/org/janelia/simview/klb/bdv/KlbImgLoader.java +++ b/src/main/java/org/janelia/simview/klb/bdv/KlbImgLoader.java @@ -16,6 +16,7 @@ import net.imglib2.*; import net.imglib2.cache.volatiles.CacheHints; import net.imglib2.cache.volatiles.LoadingStrategy; +import net.imglib2.img.basictypeaccess.DataAccess; import net.imglib2.img.Img; import net.imglib2.img.ImgFactory; import net.imglib2.img.array.ArrayImgFactory; @@ -86,7 +87,7 @@ public CacheControl getCacheControl() } - public class KlbSetupImgLoader< T extends RealType< T > & NativeType< T >, V extends Volatile< T > & NativeType< V >, A > implements ViewerSetupImgLoader< T, V >, MultiResolutionSetupImgLoader< T > + public class KlbSetupImgLoader< T extends RealType< T > & NativeType< T >, V extends Volatile< T > & NativeType< V >, A extends DataAccess > implements ViewerSetupImgLoader< T, V >, MultiResolutionSetupImgLoader< T > { private final int viewSetupId; private final long[] imageSize = new long[ 3 ]; diff --git a/src/main/java/org/janelia/simview/klb/bdv/KlbVolatileArrayLoader.java b/src/main/java/org/janelia/simview/klb/bdv/KlbVolatileArrayLoader.java index bb3bc1f..5b08a33 100644 --- a/src/main/java/org/janelia/simview/klb/bdv/KlbVolatileArrayLoader.java +++ b/src/main/java/org/janelia/simview/klb/bdv/KlbVolatileArrayLoader.java @@ -5,8 +5,9 @@ import net.imglib2.type.NativeType; import net.imglib2.type.numeric.RealType; import org.janelia.simview.klb.KLB; +import net.imglib2.img.basictypeaccess.DataAccess; -public abstract class KlbVolatileArrayLoader< T extends RealType< T > & NativeType< T >, V extends Volatile< T > & NativeType< V >, A > implements CacheArrayLoader< A > +public abstract class KlbVolatileArrayLoader< T extends RealType< T > & NativeType< T >, V extends Volatile< T > & NativeType< V >, A extends DataAccess > implements CacheArrayLoader< A > { protected final KLB klb = KLB.newInstance(); private final KlbPartitionResolver resolver; From bcca2f82186aa5caca66694fac5a9e5fc5ea4702 Mon Sep 17 00:00:00 2001 From: mhdominguez Date: Tue, 5 Mar 2024 20:29:36 -0500 Subject: [PATCH 2/2] modified: pom.xml modified: src/main/java/org/janelia/simview/klb/bdv/KlbDownsampler.java modified: src/main/java/org/janelia/simview/klb/bdv/KlbSpimDataAdapter.java modified: src/main/java/org/janelia/simview/klb/bdv/TransformsSpimreg2Simview.java modified: src/main/java/org/janelia/simview/klb/bdv/ui/ViewSetupsConfigDialog.java --- pom.xml | 4 +++- .../simview/klb/bdv/KlbDownsampler.java | 10 ++++---- .../simview/klb/bdv/KlbSpimDataAdapter.java | 24 +++++++++---------- .../klb/bdv/TransformsSpimreg2Simview.java | 9 +++---- .../klb/bdv/ui/ViewSetupsConfigDialog.java | 4 ++-- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index 68de889..dfe5a04 100644 --- a/pom.xml +++ b/pom.xml @@ -106,13 +106,15 @@ klb ${klb.version} + + sc.fiji bigdataviewer-core sc.fiji - SPIM_Registration + spim_data diff --git a/src/main/java/org/janelia/simview/klb/bdv/KlbDownsampler.java b/src/main/java/org/janelia/simview/klb/bdv/KlbDownsampler.java index 6875028..5ad767f 100644 --- a/src/main/java/org/janelia/simview/klb/bdv/KlbDownsampler.java +++ b/src/main/java/org/janelia/simview/klb/bdv/KlbDownsampler.java @@ -3,8 +3,8 @@ import bdv.export.Downsample; import bdv.export.ExportMipmapInfo; import bdv.export.ProposeMipmaps; -import bdv.spimdata.SpimDataMinimal; -import bdv.spimdata.XmlIoSpimDataMinimal; +import mpicbg.spim.data.SpimData; +import mpicbg.spim.data.XmlIoSpimData; import mpicbg.spim.data.SpimDataException; import mpicbg.spim.data.generic.sequence.AbstractSequenceDescription; import mpicbg.spim.data.generic.sequence.BasicViewSetup; @@ -63,9 +63,9 @@ public void process( final File xmlFile, final boolean skipFirst ) this.skipFirst = skipFirst; final String filePath = xmlFile.getAbsolutePath(); - SpimDataMinimal data = null; + SpimData data = null; try { - data = new XmlIoSpimDataMinimal().load( filePath ); + data = new XmlIoSpimData().load( filePath ); } catch ( SpimDataException e ) { e.printStackTrace(); } @@ -244,4 +244,4 @@ public static void main( final String[] args ) new KlbDownsampler().process( new File( filePath ), skipFirst ); } -} \ No newline at end of file +} diff --git a/src/main/java/org/janelia/simview/klb/bdv/KlbSpimDataAdapter.java b/src/main/java/org/janelia/simview/klb/bdv/KlbSpimDataAdapter.java index 40d2070..2057d2f 100644 --- a/src/main/java/org/janelia/simview/klb/bdv/KlbSpimDataAdapter.java +++ b/src/main/java/org/janelia/simview/klb/bdv/KlbSpimDataAdapter.java @@ -14,15 +14,15 @@ import java.util.HashMap; import java.util.List; -import spim.fiji.datasetmanager.MultiViewDatasetDefinition; -import spim.fiji.spimdata.SpimData2; +//import spim.fiji.datasetmanager.MultiViewDatasetDefinition; +import mpicbg.spim.data.SpimData; /** * Interfaces a KlbPartitionResolver instance with Fiji's SpimData * dataset layout description. Can be consumed directly or serialized * to XML. */ -public class KlbSpimDataAdapter implements MultiViewDatasetDefinition +public class KlbSpimDataAdapter //implements MultiViewDatasetDefinition { private final KlbPartitionResolver resolver; @@ -32,20 +32,20 @@ public KlbSpimDataAdapter( final KlbPartitionResolver resolver ) this.resolver = resolver; } - @Override + //@Override public String getTitle() { return "KLB Dataset"; } - @Override + //@Override public String getExtendedDescription() { return "KLB Dataset"; } - @Override - public SpimData2 createDataset() + //@Override + public SpimData createDataset() { // ViewSetups final long[] imageSize = new long[ 3 ]; @@ -136,15 +136,15 @@ public SpimData2 createDataset() } } - // combine all the above into a SpimData2 - return new SpimData2( new File( System.getProperty( "user.home" ) ), seq, new ViewRegistrations( registrations ), null, null ); + // combine all the above into a SpimData + return new SpimData( new File( System.getProperty( "user.home" ) ), seq, new ViewRegistrations( registrations ) ); } - @Override + /*@Override public MultiViewDatasetDefinition newInstance() { return new KlbSpimDataAdapter( null ); - } + }*/ /** * Writes the dataset definition to XML. @@ -153,7 +153,7 @@ public MultiViewDatasetDefinition newInstance() */ public void writeXML( final String filePath ) throws SpimDataException { - final SpimData2 data = createDataset(); + final SpimData data = createDataset(); data.setBasePath( new File( filePath ).getParentFile() ); new XmlIoSpimData().save( data, filePath ); } diff --git a/src/main/java/org/janelia/simview/klb/bdv/TransformsSpimreg2Simview.java b/src/main/java/org/janelia/simview/klb/bdv/TransformsSpimreg2Simview.java index 9e42b44..b78625e 100644 --- a/src/main/java/org/janelia/simview/klb/bdv/TransformsSpimreg2Simview.java +++ b/src/main/java/org/janelia/simview/klb/bdv/TransformsSpimreg2Simview.java @@ -23,8 +23,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import spim.fiji.spimdata.SpimData2; -import spim.fiji.spimdata.XmlIoSpimData2; +import mpicbg.spim.data.SpimData; +import mpicbg.spim.data.XmlIoSpimData; + @Plugin( type = Command.class, menuPath = "Plugins>Multiview Reconstruction>Convert transforms to SiMView" ) public class TransformsSpimreg2Simview implements Command @@ -58,12 +59,12 @@ public void run() { log.info( "Converting SPIM Registration transforms to SiMView standard" ); - SpimData2 spimData = null; + SpimData spimData = null; SequenceDescription seq = null; KlbImgLoader imageLoader = null; MissingViews missingViews = null; try { - spimData = new XmlIoSpimData2( null ).load( xmlFile.getAbsolutePath() ); + spimData = new XmlIoSpimData().load( xmlFile.getAbsolutePath() ); seq = spimData.getSequenceDescription(); imageLoader = ( KlbImgLoader ) seq.getImgLoader(); missingViews = seq.getMissingViews(); diff --git a/src/main/java/org/janelia/simview/klb/bdv/ui/ViewSetupsConfigDialog.java b/src/main/java/org/janelia/simview/klb/bdv/ui/ViewSetupsConfigDialog.java index b800c80..e398ca3 100644 --- a/src/main/java/org/janelia/simview/klb/bdv/ui/ViewSetupsConfigDialog.java +++ b/src/main/java/org/janelia/simview/klb/bdv/ui/ViewSetupsConfigDialog.java @@ -14,7 +14,7 @@ import java.awt.event.*; import java.io.File; -import spim.fiji.spimdata.SpimData2; +import mpicbg.spim.data.SpimData; public class ViewSetupsConfigDialog extends JDialog implements ActionListener { @@ -134,7 +134,7 @@ public void actionPerformed( final ActionEvent e ) } else if ( source == viewButton ) { final KlbPartitionResolver resolver = getResolver(); final KlbSpimDataAdapter spimDataAdapter = new KlbSpimDataAdapter( resolver ); - final SpimData2 spimData = spimDataAdapter.createDataset(); + final SpimData spimData = spimDataAdapter.createDataset(); BigDataViewer.open( spimData, "", new ProgressWriterConsole(), ViewerOptions.options() ); dispose(); }