Skip to content

Support for intensity adjustment with "Closest To Its Tile Center" fusion #159

@matham

Description

@matham

I really like the new option for fusion where Pixel Closest To Its Tile Center Wins. However, this doesn't currently support adjusting intensity as well. Leading to very sharp boundaries between tiles, when the intensities are somewhat different.

Would it be possible to add support for adjusting intensities with this fusion mode?

Here's the console log output:

Using spimdata version: 0.9-revision
Using multiview-reconstruction version: 7.0.7
Trying to parse ''
Trying to parse 'file:/E:/MF1_262M_W/MF1_262M_W_BS.xml'
Trying to parse 'file:/E:/MF1_262M_W/MF1_262M_W_BS.xml'
angles selected: 0
channels selected: 0, 1, 2
illuminations selected: 0
tiles selected: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
Timepoints selected: 0
No corresponding interest points available.
To enable non-rigid please run Interest Point Detection followed by Intererst Point Registration (e.g. ICP) first
avgAnisoF: 1.9692307692307653
Wed Oct 22 14:52:14 EDT 2025: Selected Fusion Parameters: 
Downsampling: None
BoundingBox: Bounding Box 'All Views' (-16, -6898, -25) >>> (6117, 2187, 3966)
DownsampledBoundingBox: FinalInterval [(-16, -6898, -13) -- (6117, 2187, 2014) = 6134x9086x2028]
PixelType: 32-bit floating point
FusionType: Pixel Closest To Its Tile Center Wins
Manually defined min/max: false
Interpolation: Linear Interpolation
Adjust intensities: true
AnisotropyFactor: 1.9692307692307653
Split by: Each timepoint & channel
Image Export: Save as (compressed) TIFF stacks
ImgLoader.isVirtual(): true
ImgLoader.isMultiResolution(): true
Non-Rigid active: false
(Wed Oct 22 14:52:35 EDT 2025): Fusing group 1/3 (group=0-0 >-> 0-23)
Wed Oct 22 14:52:35 EDT 2025: Approximate pixel size of fused image (without downsampling): 2.03125 µm
(Wed Oct 22 14:52:35 EDT 2025): block size used during fusion: (128, 128, 1)
BlkAffineFusion: Fusion method not supported (yet). Falling back to LazyAffineFusion.
Wed Oct 22 14:52:36 EDT 2025: Saving file G:\MF1_262M_W\MF1_262M_W_fused_tp_0_ch_0.tif

And the errors:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: fusion type CLOSEST_PIXEL_WINS not supported.
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at net.imglib2.display.projector.MultithreadedIterableIntervalProjector2D.map(MultithreadedIterableIntervalProjector2D.java:213)
	at net.imglib2.img.display.imagej.ImageJVirtualStack.project(ImageJVirtualStack.java:181)
	at net.imglib2.img.display.imagej.ImageJVirtualStack.getSlice(ImageJVirtualStack.java:171)
	at net.imglib2.img.display.imagej.ImageJVirtualStack.getPixelsZeroBasedIndex(ImageJVirtualStack.java:198)
	at net.imglib2.img.display.imagej.AbstractVirtualStack.getPixels(AbstractVirtualStack.java:102)
	at net.imglib2.img.display.imagej.AbstractVirtualStack.getProcessor(AbstractVirtualStack.java:163)
	at ij.ImagePlus.setStack(ImagePlus.java:846)
	at ij.ImagePlus.<init>(ImagePlus.java:162)
	at net.imglib2.img.display.imagej.ImageJFunctions.makeImagePlus(ImageJFunctions.java:299)
	at net.imglib2.img.display.imagej.ImageJFunctions.wrapFloat(ImageJFunctions.java:287)
	at net.imglib2.img.display.imagej.ImageJFunctions.wrap(ImageJFunctions.java:231)
	at net.preibisch.mvrecon.process.export.DisplayImage.getImagePlusInstance(DisplayImage.java:208)
	at net.preibisch.mvrecon.process.export.Save3dTIFF.exportImage(Save3dTIFF.java:109)
	at net.preibisch.mvrecon.fiji.plugin.Image_Fusion.fuse(Image_Fusion.java:285)
	at net.preibisch.mvrecon.fiji.spimdata.explorer.popup.FusionPopup$MyActionListener$1.run(FusionPopup.java:82)
	at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: fusion type CLOSEST_PIXEL_WINS not supported.
	at net.imglib2.cache.util.CacheAsUncheckedCacheAdapter.get(CacheAsUncheckedCacheAdapter.java:78)
	at net.imglib2.img.cell.LazyCellImg$LazyCells.get(LazyCellImg.java:116)
	at net.imglib2.img.cell.LazyCellImg$LazyCells.get(LazyCellImg.java:100)
	at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:274)
	at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
	at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
	at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:88)
	at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:53)
	at net.imglib2.type.numeric.real.FloatType.updateContainer(FloatType.java:98)
	at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
	at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
	at net.imglib2.display.projector.MultithreadedIterableIntervalProjector2D$1.call(MultithreadedIterableIntervalProjector2D.java:178)
	at net.imglib2.display.projector.MultithreadedIterableIntervalProjector2D$1.call(MultithreadedIterableIntervalProjector2D.java:122)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	... 1 more
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: fusion type CLOSEST_PIXEL_WINS not supported.
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:145)
	at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
	at net.imglib2.cache.util.CacheAsUncheckedCacheAdapter.get(CacheAsUncheckedCacheAdapter.java:74)
	... 16 more
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: fusion type CLOSEST_PIXEL_WINS not supported.
	at net.imglib2.cache.util.CacheAsUncheckedCacheAdapter.get(CacheAsUncheckedCacheAdapter.java:78)
	at net.imglib2.img.cell.LazyCellImg$LazyCells.get(LazyCellImg.java:116)
	at net.imglib2.img.cell.LazyCellImg$LazyCells.get(LazyCellImg.java:100)
	at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:274)
	at net.imglib2.blocks.CellImgRangeCopier.copyRanges(CellImgRangeCopier.java:221)
	at net.imglib2.blocks.CellImgRangeCopier.copy(CellImgRangeCopier.java:170)
	at net.imglib2.blocks.CellImgRangeCopier.copy(CellImgRangeCopier.java:168)
	at net.imglib2.blocks.CellImgRangeCopier.copy(CellImgRangeCopier.java:168)
	at net.imglib2.blocks.CellImgRangeCopier.copy(CellImgRangeCopier.java:145)
	at net.imglib2.blocks.ViewPrimitiveBlocks.copy(ViewPrimitiveBlocks.java:171)
	at net.imglib2.algorithm.blocks.PrimitiveBlocksSupplier.copy(PrimitiveBlocksSupplier.java:64)
	at net.imglib2.algorithm.blocks.AbstractBlockSupplier$1.copy(AbstractBlockSupplier.java:74)
	at net.imglib2.algorithm.blocks.BlockAlgoUtils.lambda$cellLoader$0(BlockAlgoUtils.java:56)
	at net.imglib2.cache.img.LoadedCellCacheLoader.get(LoadedCellCacheLoader.java:124)
	at net.imglib2.cache.img.LoadedCellCacheLoader.get(LoadedCellCacheLoader.java:85)
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:135)
	... 18 more
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: fusion type CLOSEST_PIXEL_WINS not supported.
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:145)
	at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
	at net.imglib2.cache.util.CacheAsUncheckedCacheAdapter.get(CacheAsUncheckedCacheAdapter.java:74)
	... 33 more
Caused by: java.lang.RuntimeException: fusion type CLOSEST_PIXEL_WINS not supported.
	at net.preibisch.mvrecon.process.fusion.FusionTools.fuseVirtual(FusionTools.java:579)
	at net.preibisch.mvrecon.process.fusion.lazy.LazyAffineFusion.accept(LazyAffineFusion.java:132)
	at net.preibisch.mvrecon.process.fusion.lazy.LazyAffineFusion.accept(LazyAffineFusion.java:66)
	at net.imglib2.cache.img.LoadedCellCacheLoader.get(LoadedCellCacheLoader.java:124)
	at net.imglib2.cache.img.LoadedCellCacheLoader.get(LoadedCellCacheLoader.java:85)
	at net.imglib2.cache.ref.SoftRefLoaderCache.get(SoftRefLoaderCache.java:135)
	... 35 more

And an example fusion without adjusting intensities:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions