Skip to content

BUG: CreateTiledMosaic would not write images without an RGB overlay#1849

Merged
cookpa merged 1 commit intomasterfrom
mosaic_pixel
Feb 17, 2025
Merged

BUG: CreateTiledMosaic would not write images without an RGB overlay#1849
cookpa merged 1 commit intomasterfrom
mosaic_pixel

Conversation

@cookpa
Copy link
Member

@cookpa cookpa commented Feb 17, 2025

This was because it tried to write the mosaic with RealType pixels, which many formats do not support.

COMP: Bump ITK version string in cmake

This was because it tried to write with RealType pixels, which many formats do not support.

COMP: Bump ITK version string in cmake
@gdevenyi
Copy link
Contributor

Can you give an example of a command this fixes? I've been fighting with trying to create mosiac images for a long time and I'm wondering if I had issues with this. Thanks.

@cookpa
Copy link
Member Author

cookpa commented Feb 17, 2025

CreateTiledMosaic -i t1w.nii.gz -o mosaic.png -t -1x-1 -p 5 -s 3 -d 2 -f 0x1

used to fail with something like

terminate called after throwing an instance of 'itk::ExceptionObject'
  what():  /build/ITKv5/Modules/IO/PNG/src/itkPNGImageIO.cxx:544:
PNG supports unsigned char and unsigned short

The way it's used in ANTs scripts always worked

CreateTiledMosaic -i t1w.nii.gz -o mosaic.png -r rgb.nii.gz -t -1x-1 -p 5 -a 0.5 -s 3 -d 2 -f 0x1

because the RGB overlay was used to compute an RGB pixel in the output, so the type conflict didn't happen.

@cookpa cookpa merged commit af7c9b3 into master Feb 17, 2025
1 check passed
@cookpa cookpa deleted the mosaic_pixel branch February 17, 2025 22:27
@gdevenyi
Copy link
Contributor

Cheers, I already had sorted out a way to avoid this one when I don't have any overlay. This is nice to have solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants