Skip to content

Commit

Permalink
Merge branch 'PreibischLab:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdominguez authored Sep 14, 2023
2 parents a1d8d07 + fff10f9 commit d382e3a
Show file tree
Hide file tree
Showing 110 changed files with 2,251 additions and 812 deletions.
14 changes: 7 additions & 7 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble
Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Expand Down Expand Up @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.

GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
Expand Down Expand Up @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

NO WARRANTY
NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
Expand All @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
Expand Down
24 changes: 17 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>33.2.0</version>
<version>36.0.0</version>
<relativePath />
</parent>

<groupId>net.preibisch</groupId>
<artifactId>multiview-reconstruction</artifactId>
<version>1.2.9-SNAPSHOT</version>
<version>3.2.4-SNAPSHOT</version>

<name>Multiview Reconstruction</name>
<description>Software for the reconstruction of multi-view microscopic acquisitions
Expand Down Expand Up @@ -99,10 +99,18 @@ like Selective Plane Illumination Microscopy (SPIM) Data.</description>
<license.licenseName>gpl_v2</license.licenseName>
<license.copyrightOwners>Multiview Reconstruction developers.</license.copyrightOwners>

<multiview-simulation.version>0.2.0</multiview-simulation.version>
<pyramidio.version>1.1.0</pyramidio.version>
<ijp-kheops.version>0.3.4</ijp-kheops.version>

<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>

<imglib2.version>6.1.0</imglib2.version>
<imglib2-algorithm.version>0.13.2</imglib2-algorithm.version>
<imglib2-cache.version>1.0.0-beta-17</imglib2-cache.version>
<bigdataviewer-core.version>10.4.6</bigdataviewer-core.version>
<bigdataviewer-vistools.version>1.0.0-beta-32</bigdataviewer-vistools.version>
<n5-imglib2.version>5.0.0</n5-imglib2.version>
</properties>

<repositories>
Expand Down Expand Up @@ -158,7 +166,6 @@ like Selective Plane Illumination Microscopy (SPIM) Data.</description>
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-algorithm</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>net.imglib2</groupId>
Expand Down Expand Up @@ -241,7 +248,6 @@ like Selective Plane Illumination Microscopy (SPIM) Data.</description>
<dependency>
<groupId>args4j</groupId>
<artifactId>args4j</artifactId>
<version>2.33</version>
</dependency>
<dependency>
<groupId>org.janelia.saalfeldlab</groupId>
Expand All @@ -262,12 +268,16 @@ like Selective Plane Illumination Microscopy (SPIM) Data.</description>
<dependency>
<groupId>gov.nist.isg</groupId>
<artifactId>pyramidio</artifactId>
<version>1.1.0</version>
<version>${pyramidio.version}</version>
</dependency>
<dependency>
<groupId>ch.epfl.biop</groupId>
<artifactId>ijp-kheops</artifactId>
<version>0.3.4</version>
<version>${ijp-kheops.version}</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public String getExtendedDescription()
}

@Override
public SpimData2 createDataset()
public SpimData2 createDataset( final String xmlFileName )
{
final DHMMetaData meta = queryDirectoryAndRatio();

Expand Down Expand Up @@ -116,7 +116,7 @@ public SpimData2 createDataset()

// create the initial view interest point object
final ViewInterestPoints viewInterestPoints = new ViewInterestPoints();
viewInterestPoints.createViewInterestPoints( sequenceDescription.getViewDescriptions() );
//viewInterestPoints.createViewInterestPoints( sequenceDescription.getViewDescriptions() );

// finally create the SpimData itself based on the sequence description and the view registration
final SpimData2 spimData = new SpimData2( meta.getDir(), sequenceDescription, viewRegistrations, viewInterestPoints, new BoundingBoxes(), new PointSpreadFunctions(), new StitchingResults(), new IntensityAdjustments() );
Expand Down Expand Up @@ -207,6 +207,6 @@ public MultiViewDatasetDefinition newInstance()

public static void main( String[] args )
{
new DHM().createDataset();
new DHM().createDataset( "dataset.xml" );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@
public class FileListDatasetDefinition implements MultiViewDatasetDefinition
{
public static final String[] GLOB_SPECIAL_CHARS = new String[] {"{", "}", "[", "]", "*", "?"};
public static final String[] loadChoices = new String[] { "Re-save as multiresolution HDF5", "Re-save as multiresolution N5", "Load raw data virtually (with caching)", "Load raw data"};
//public static final String[] loadChoices = new String[] { "Re-save as multiresolution HDF5", "Re-save as multiresolution N5", "Load raw data virtually (with caching)", "Load raw data"};
public static final String[] loadChoicesNew = new String[] { "Re-save as multiresolution HDF5", "Re-save as multiresolution N5", "Load raw data directly"};
public static final String Z_VARIABLE_CHOICE = "Z-Planes (experimental)";

public static boolean windowsHack = true;

public static int defaultLoadChoice = 0;
public static boolean defaultVirtual = true;

private static ArrayList<FileListChooser> fileListChoosers = new ArrayList<>();
static
{
Expand Down Expand Up @@ -619,9 +623,9 @@ else if ( aInfoI.axis == 2 )

final ImgLoader imgLoader;
if (withVirtualLoader)
imgLoader = new FileMapImgLoaderLOCI2( fileMap, FileListDatasetDefinitionUtil.selectImgFactory(state.getDimensionMap()), sd, state.getWasZGrouped() );
imgLoader = new FileMapImgLoaderLOCI2( fileMap, sd, state.getWasZGrouped() );
else
imgLoader = new FileMapImgLoaderLOCI( fileMap, FileListDatasetDefinitionUtil.selectImgFactory(state.getDimensionMap()), sd, state.getWasZGrouped() );
imgLoader = new FileMapImgLoaderLOCI( fileMap, sd, state.getWasZGrouped() );
sd.setImgLoader( imgLoader );

double minResolution = Double.MAX_VALUE;
Expand All @@ -636,15 +640,15 @@ else if ( aInfoI.axis == 2 )

// create the initial view interest point object
final ViewInterestPoints viewInterestPoints = new ViewInterestPoints();
viewInterestPoints.createViewInterestPoints( sd.getViewDescriptions() );
//viewInterestPoints.createViewInterestPoints( sd.getViewDescriptions() );

SpimData2 data = new SpimData2( new File("/"), sd, vrs, viewInterestPoints, new BoundingBoxes(), new PointSpreadFunctions(), new StitchingResults(), new IntensityAdjustments() );
return data;
}


@Override
public SpimData2 createDataset( )
public SpimData2 createDataset( final String xmlFileName )
{

FileListChooser chooser = fileListChoosers.get( 0 );
Expand Down Expand Up @@ -1078,7 +1082,8 @@ else if (choice.equals( Z_VARIABLE_CHOICE ))
GenericDialogPlus gdSave = new GenericDialogPlus( "Save dataset definition" );

addMessageAsJLabel("<html> <h1> Loading options </h1> <br /> </html>", gdSave);
gdSave.addChoice( "how_to_load_images", loadChoices, loadChoices[0] );
gdSave.addChoice( "how_to_load_images", loadChoicesNew, loadChoicesNew[defaultLoadChoice] );
gdSave.addCheckbox( "load_raw_data_virtually (also when resaving to HDF5/N5, slower, but supports larger stacks)", defaultVirtual );

addMessageAsJLabel("<html><h2> Save path </h2></html>", gdSave);

Expand Down Expand Up @@ -1123,8 +1128,9 @@ else if (choice.equals( Z_VARIABLE_CHOICE ))
if ( gdSave.wasCanceled() )
return null;

final int loadChoice = gdSave.getNextChoiceIndex();
final boolean useVirtualLoader = loadChoice == 2; //"Re-save as multiresolution HDF5", "Re-save as multiresolution N5", "Load raw data virtually (with caching)", "Load raw data"
final int loadChoice = defaultLoadChoice = gdSave.getNextChoiceIndex();
final boolean useVirtualLoader = defaultVirtual = gdSave.getNextBoolean();

// re-build the SpimData if user explicitly doesn't want virtual loading
if (!useVirtualLoader)
data = buildSpimData( state, useVirtualLoader );
Expand Down Expand Up @@ -1196,20 +1202,23 @@ public int compare(Group< ViewDescription > o1, Group< ViewDescription > o2)
{
final Map< Integer, ExportMipmapInfo > perSetupExportMipmapInfo = Resave_HDF5.proposeMipmaps( data.getSequenceDescription().getViewSetupsOrdered() );
final int firstviewSetupId = data.getSequenceDescription().getViewSetupsOrdered().get( 0 ).getId();
Generic_Resave_HDF5.lastExportPath = String.join( File.separator, chosenPath.getAbsolutePath(), "dataset");
final Parameters params = Generic_Resave_HDF5.getParameters( perSetupExportMipmapInfo.get( firstviewSetupId ), true, true );
//Generic_Resave_HDF5.lastExportPath = String.join( File.separator, chosenPath.getAbsolutePath(), "dataset");
final Parameters params = Generic_Resave_HDF5.getParameters( perSetupExportMipmapInfo.get( firstviewSetupId ), false, true );

// HDF5 options dialog was cancelled
if (params == null)
return null;

params.setHDF5File(new File( chosenPath.getAbsolutePath(), xmlFileName.subSequence( 0, xmlFileName.length() - 4 ) + ".h5" ) );
params.setSeqFile(new File( chosenPath.getAbsolutePath(), xmlFileName ) );

final ProgressWriter progressWriter = new ProgressWriterIJ();
progressWriter.out().println( "starting export..." );

Generic_Resave_HDF5.writeHDF5( data, params, progressWriter );

IOFunctions.println( "(" + new Date( System.currentTimeMillis() ) + "): HDF5 resave finished." );

net.preibisch.mvrecon.fiji.ImgLib2Temp.Pair< SpimData2, List< String > > result = Resave_HDF5.createXMLObject( data, new ArrayList<>(data.getSequenceDescription().getViewDescriptions().keySet()), params, progressWriter, true );

// ensure progressbar is gone
Expand All @@ -1224,7 +1233,7 @@ public int compare(Group< ViewDescription > o1, Group< ViewDescription > o2)
final ArrayList< ViewDescription > viewIds = new ArrayList<>( data.getSequenceDescription().getViewDescriptions().values() );
Collections.sort( viewIds );

final File xmlFile = new File( chosenPath.getAbsolutePath(), "dataset.xml" );
final File xmlFile = new File( chosenPath.getAbsolutePath(), xmlFileName );

final SequenceDescription sd = data.getSequenceDescription();

Expand All @@ -1236,7 +1245,8 @@ public int compare(Group< ViewDescription > o1, Group< ViewDescription > o2)
if ( n5params == null )
return null;

n5params.n5File = new File( chosenPath.getAbsolutePath(), "dataset.n5" );
// n5-filename is same as XML name now (set in N5Parameters.getParamtersIJ)
//n5params.n5File = new File( chosenPath.getAbsolutePath(), "dataset.n5" );

Resave_N5.resaveN5( data, viewIds, n5params );

Expand Down
Loading

0 comments on commit d382e3a

Please sign in to comment.