Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ff4f669
Add some testing code for flat field correction
minnerbe Jan 8, 2026
5af74de
Add viewer image loader and a test for flat field correction
minnerbe Jan 8, 2026
73128ef
Use exising xml capabilities to orchestrate flat field correction
minnerbe Jan 8, 2026
6e757e2
Add xml capabilities for flat field correction viewer loader
minnerbe Jan 8, 2026
815815a
Slightly adjust coding style for readability
minnerbe Jan 8, 2026
f25371a
Refactor some bright/darkfield loading code
minnerbe Jan 9, 2026
4f4b596
Use new downsampling code in correction
minnerbe Jan 9, 2026
882ac04
Refactor bright/darkfield loading in viewer implementation
minnerbe Jan 9, 2026
26b859c
Fix some IDE warnings
minnerbe Jan 9, 2026
cbebfe5
Add a small script to convert tiffs to zarrs for testing
minnerbe Jan 9, 2026
e2582d0
First LLM-generated attempt at using N5 api for dark/flatfield IO
minnerbe Jan 9, 2026
1755b69
Fix xml file generation in test setup
minnerbe Jan 9, 2026
135b1e3
Fix some bug in zarr conversion for testing
minnerbe Jan 9, 2026
13396d3
Fix some IDE warnings
minnerbe Jan 9, 2026
28fc722
Remove unnecessary array copies
minnerbe Jan 9, 2026
91f03b9
Fix some IDE warnings
minnerbe Jan 9, 2026
48304d0
Pull out common flatfield loading code
minnerbe Jan 9, 2026
6088e82
Use input cell size for downsampled flatfields
minnerbe Jan 9, 2026
5365bd6
Merge branch 'zarrv3' into experiments/lazy-correction
minnerbe Jan 22, 2026
4c728f9
Add class to store info about flatfield storage
minnerbe Feb 2, 2026
87c7dea
Use FlatfieldImageInfo in loaders
minnerbe Feb 2, 2026
b530aec
Add xml support for new image info format
minnerbe Feb 2, 2026
9851d7e
Update xml files and tests to new format
minnerbe Feb 2, 2026
d5705bc
Add new test xml for loading from s3
minnerbe Feb 2, 2026
274068d
Update alpha versions of some N5 dependencies
minnerbe Feb 3, 2026
b88cfda
Add benchmark for fusion with and without correction
minnerbe Feb 3, 2026
1df6f09
Implement move methods of FlatFieldCorrectedRandomAccessibleInterval
minnerbe Feb 3, 2026
46fda13
Simplify FlatFieldCorrectedRandomAccessibleInterval logic
minnerbe Feb 4, 2026
702b8ab
Add block supplier for flat field correction
minnerbe Feb 4, 2026
0dcd4e2
Add block supplier to benchmark
minnerbe Feb 4, 2026
3aa66a4
Implement flat field corrected image on top of block supplier
minnerbe Feb 4, 2026
76b6ddc
Simplify benchmark
minnerbe Feb 4, 2026
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
506 changes: 506 additions & 0 deletions data/dataset.xml

Large diffs are not rendered by default.

417 changes: 417 additions & 0 deletions data/dataset_corrected.xml

Large diffs are not rendered by default.

417 changes: 417 additions & 0 deletions data/dataset_corrected_viewer.xml

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions data/dataset_corrected_viewer_s3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<SpimData version="0.2">
<BasePath type="relative">.</BasePath>
<SequenceDescription>
<ImageLoader format="spimreconstruction.wrapped.flatfield.viewer" Active="true" Cached="true">
<WrappedImgLoader>
<ImageLoader format="bdv.n5" version="1.1">
<n5 type="relative">https://s3.janelia.org/keller-lab/s12a/samples_for_stitching/fly_brain_3/basic_corrected/dataset.n5</n5>
</ImageLoader>
</WrappedImgLoader>
<FlatFields>
<FlatField Timepoint="0" ViewSetup="0">
<BrightImg format="n5">https://s3.janelia.org/keller-lab/s12a/samples_for_stitching/fly_brain_3/kittisopikulm/camera1/dark_field/s0/</BrightImg>
<DarkImg format="n5" >https://s3.janelia.org/keller-lab/s12a/samples_for_stitching/fly_brain_3/kittisopikulm/camera1/flat_field/s0/</DarkImg>
</FlatField>
</FlatFields>
</ImageLoader>
<ViewSetups>
<ViewSetup>
<id>0</id>
<name>0</name>
<size>512 320 825</size>
<voxelSize>
<unit>pixels</unit>
<size>1.0 1.0 3.0</size>
</voxelSize>
<attributes>
<illumination>0</illumination>
<channel>0</channel>
<tile>187</tile>
<angle>0</angle>
</attributes>
</ViewSetup>
<Attributes name="illumination">
<Illumination>
<id>0</id>
<name>0</name>
</Illumination>
</Attributes>
<Attributes name="channel">
<Channel>
<id>0</id>
<name>0</name>
</Channel>
</Attributes>
<Attributes name="tile">
<Tile>
<id>187</id>
<name>187</name>
</Tile>
<Tile>
<id>188</id>
<name>188</name>
</Tile>
<Tile>
<id>189</id>
<name>189</name>
</Tile>
<Tile>
<id>200</id>
<name>200</name>
</Tile>
<Tile>
<id>201</id>
<name>201</name>
</Tile>
<Tile>
<id>202</id>
<name>202</name>
</Tile>
<Tile>
<id>213</id>
<name>213</name>
</Tile>
<Tile>
<id>214</id>
<name>214</name>
</Tile>
<Tile>
<id>215</id>
<name>215</name>
</Tile>
</Attributes>
<Attributes name="angle">
<Angle>
<id>0</id>
<name>0</name>
</Angle>
</Attributes>
</ViewSetups>
<Timepoints type="pattern">
<integerpattern>0</integerpattern>
</Timepoints>
<MissingViews />
</SequenceDescription>
<ViewRegistrations>
<ViewRegistration timepoint="0" setup="0">
<ViewTransform type="affine">
<Name>AffineModel3D regularized with an RigidModel3D, lambda = 0.1</Name>
<affine>1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0</affine>
</ViewTransform>
<ViewTransform type="affine">
<Name>Stitching Transform</Name>
<affine>1.0 0.0 0.0 0.4554158176323426 0.0 1.0 0.0 -0.13328548693164066 0.0 0.0 1.0 1.039028825990859</affine>
</ViewTransform>
<ViewTransform type="affine">
<Name>Translation to Regular Grid</Name>
<affine>1.0 0.0 0.0 199.68 0.0 1.0 0.0 102.40000000000003 0.0 0.0 1.0 -1236.0</affine>
</ViewTransform>
<ViewTransform type="affine">
<Name>calibration</Name>
<affine>1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 3.0 0.0</affine>
</ViewTransform>
</ViewRegistration>
</ViewRegistrations>
<ViewInterestPoints />
<BoundingBoxes />
<PointSpreadFunctions />
<StitchingResults />
<IntensityAdjustments />
</SpimData>
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ like Selective Plane Illumination Microscopy (SPIM) Data.</description>

<!-- N5 alpha versions for Zarr v3 shard support -->
<!-- See: https://imglib.github.io/imglib2-blog/posts/2025-12-22-n5-shard-dev/ -->
<n5.version>4.0.0-alpha-6</n5.version>
<n5-imglib2.version>7.1.0-alpha-6</n5-imglib2.version>
<n5.version>4.0.0-alpha-7</n5.version>
<n5-imglib2.version>7.1.0-alpha-7</n5-imglib2.version>
<n5-universe.version>2.4.0-alpha-6</n5-universe.version>
<n5-zarr.version>2.0.0-alpha-4</n5-zarr.version>
<n5-zstandard.version>2.0.0-alpha-4</n5-zstandard.version>
<n5-blosc.version>2.0.0-alpha-4</n5-blosc.version>
<n5-aws-s3.version>4.4.0-alpha-5</n5-aws-s3.version>
</properties>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import net.preibisch.mvrecon.fiji.spimdata.explorer.ExplorerWindow;
import net.preibisch.mvrecon.fiji.spimdata.imgloaders.flatfield.DefaultFlatfieldCorrectionWrappedImgLoader;
import net.preibisch.mvrecon.fiji.spimdata.imgloaders.flatfield.FlatfieldCorrectionWrappedImgLoader;
import net.preibisch.mvrecon.fiji.spimdata.imgloaders.flatfield.FlatfieldImageInfo;
import net.preibisch.mvrecon.fiji.spimdata.imgloaders.flatfield.LazyLoadingFlatFieldCorrectionMap;
import net.preibisch.mvrecon.fiji.spimdata.imgloaders.flatfield.MultiResolutionFlatfieldCorrectionWrappedImgLoader;

Expand Down Expand Up @@ -101,10 +102,10 @@ public void actionPerformed(ActionEvent e)
.isCached()
: true );

Map< ViewId, Pair< File, File > > fileMap = null;
Map<ViewId, Pair<FlatfieldImageInfo, FlatfieldImageInfo>> infoMap = null;
if ( alreadyFF )
fileMap = ( (LazyLoadingFlatFieldCorrectionMap< ImgLoader >) data.getSequenceDescription()
.getImgLoader() ).getFileMap();
infoMap = ((LazyLoadingFlatFieldCorrectionMap<ImgLoader>) data.getSequenceDescription()
.getImgLoader()).getInfoMap();

for ( Channel c : channels )
for ( Illumination ill : illums )
Expand All @@ -120,13 +121,12 @@ public void actionPerformed(ActionEvent e)
} ).findAny().orElseGet( null );

if ( anyViewId != null )
if ( fileMap.containsKey( anyViewId ) )
{
Pair< File, File > files = fileMap.get( anyViewId );
if ( files.getA() != null )
bright = files.getA().getAbsolutePath();
if ( files.getB() != null )
dark = files.getB().getAbsolutePath();
if (infoMap.containsKey(anyViewId)) {
Pair<FlatfieldImageInfo, FlatfieldImageInfo> infos = infoMap.get(anyViewId);
if (infos.getA() != null)
bright = new File(infos.getA().getUri()).getAbsolutePath();
if (infos.getB() != null)
dark = new File(infos.getB().getUri()).getAbsolutePath();
}
}
gdp.addMessage( "Channel: " + c.getName() + ", Illumination: " + ill.getName() + ":" );
Expand Down Expand Up @@ -160,12 +160,16 @@ else if ( data.getSequenceDescription().getImgLoader() instanceof MultiResolutio
File lightFile = !lightPath.equals( "" ) ? new File( lightPath ) : null;
File darkFile = !darkPath.equals( "" ) ? new File( darkPath ) : null;

final File finalLightFile = lightFile;
final File finalDarkFile = darkFile;
data.getSequenceDescription().getViewDescriptions().entrySet().forEach( el -> {
if ( el.getValue().getViewSetup().getChannel() == c
&& el.getValue().getViewSetup().getIllumination() == ill )
{
ffIL.setBrightImage( el.getKey(), lightFile );
ffIL.setDarkImage( el.getKey(), darkFile );
if (finalLightFile != null)
ffIL.setBrightImage( el.getKey(), new FlatfieldImageInfo(finalLightFile.toURI(), null) );
if (finalDarkFile != null)
ffIL.setDarkImage( el.getKey(), new FlatfieldImageInfo(finalDarkFile.toURI(), null) );
}
} );
}
Expand Down
Loading