Skip to content

Commit

Permalink
fix: ConverterSetups ids
Browse files Browse the repository at this point in the history
* fixes project serialization bug
  • Loading branch information
bogovicj committed Oct 16, 2024
1 parent 3cf7946 commit 38706c9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/bigwarp/BigWarpInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ public static < T extends NativeType<T> > SourceInfo loadN5SourceInfo( final Big
return loadN5SourceInfo( bwData, n5, n5Dataset, queue, sourceId, moving );
}

@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
public static < T extends NativeType<T>> SourceInfo loadN5SourceInfo( final BigWarpData<?> bwData, final N5Reader n5, final String n5Dataset, final SharedQueue queue,
final int sourceId, final boolean moving )
{
Expand All @@ -751,6 +751,11 @@ public static < T extends NativeType<T>> SourceInfo loadN5SourceInfo( final BigW
{}

final SourceAndConverter<T> sac = (SourceAndConverter<T>)openN5VSourceAndConverter( bwData, n5, meta, queue);
if( bwData != null ) {
bwData.sources.add((SourceAndConverter)sac);
bwData.converterSetups.add( BigDataViewer.createConverterSetup(sac, sourceId));
}

final String uri = n5.getURI().toString() + "$" + n5Dataset;
final SourceInfo info = new SourceInfo(sourceId, moving, sac.getSpimSource().getName(), () -> uri );
info.setSourceAndConverter(sac);
Expand Down Expand Up @@ -871,10 +876,6 @@ public static <T extends NativeType<T> & NumericType<T>> SourceAndConverter<T> o
BdvOptions.options());

if (sources.size() > 0) {
if( bwData != null ) {
bwData.sources.add((SourceAndConverter)sources.get(0));
bwData.converterSetups.add(converterSetups.get(0));
}
return sources.get(0);
}
} catch (final IOException e) {}
Expand Down

0 comments on commit 38706c9

Please sign in to comment.