Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #4 to bring compatibility with bigdataviewer-core 10.4.12 #6

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>28.0.0</version>
<version>37.0.0</version>
<relativePath />
</parent>

<groupId>org.janelia.simview</groupId>
Expand Down Expand Up @@ -89,6 +90,7 @@
<additionalparam>-Xdoclint:none</additionalparam>
<klb.version>0.3.6</klb.version>
<!-- <enforcer.skip>true</enforcer.skip> -->
<bigdataviewer-core.version>10.4.12</bigdataviewer-core.version>
</properties>

<repositories>
Expand All @@ -104,18 +106,30 @@
<artifactId>klb</artifactId>
<version>${klb.version}</version>
</dependency>

<!-- BigDataViewer dependencies -->
<dependency>
<groupId>sc.fiji</groupId>
<artifactId>bigdataviewer-core</artifactId>
</dependency>
<dependency>
<groupId>sc.fiji</groupId>
<artifactId>SPIM_Registration</artifactId>
<artifactId>spim_data</artifactId>
</dependency>


<!-- ImgLib2 dependencies -->
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-cache</artifactId>
</dependency>
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2</artifactId>
</dependency>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout</artifactId>
<classifier>swing</classifier>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-ij</artifactId>
</dependency>
</dependencies>

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/janelia/simview/klb/bdv/KlbDownsampler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -244,4 +244,4 @@ public static void main( final String[] args )
new KlbDownsampler().process( new File( filePath ), skipFirst );
}

}
}
3 changes: 2 additions & 1 deletion src/main/java/org/janelia/simview/klb/bdv/KlbImgLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ];
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/janelia/simview/klb/bdv/KlbSpimDataAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ];
Expand Down Expand Up @@ -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.
Expand All @@ -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 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
}
Expand Down