jo-mueller / Slice2Volume

Script that registers Histology slices to volumetric image data
BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

Scaling issue #26

Closed LolaaPe closed 1 year ago

LolaaPe commented 1 year ago

Hi Johannes, When running S2V with the attacched parameters, the Output Stack doesn't fit the atlas I registered my histological images to (image attached). The output stack seemes to be much smaller than the atlas. Thanks for your help!

S2V scaling issue

S2V parameters

jo-mueller commented 1 year ago

Hi @LolaaPe ,

thanks for reporting! I encountered this error earlier and thought I had it fixed for most cases, but apparently that's not the case. Two questoins:

Things you could try:

(NumberOfResolutions 5)
(FixedImagePyramidSchedule 64 64 16 16 8 8 2 2 1 1)
(MovingImagePyramidSchedule 16 16 16 16 8 8 2 2 1 1)

You could try increasing the NumberOfResolutions parameter to 6, in which case you would have to change the two other lines into something like this:

(FixedImagePyramidSchedule 82 82 64 64 16 16 8 8 2 2 1 1)
(MovingImagePyramidSchedule 82 82 16 16 16 16 8 8 2 2 1 1)

Basically, this blurs both the fixed and the target image (the atlas image and the histological image to be registered) A LOT so that they overlap better - the registration is then able to do the rest. However, if they do not overlap well in the beginning, elastix doesn't know how to change the transformation in order to make the registration better - hope this makes sense.

LolaaPe commented 1 year ago

Hi @jo-mueller,

thanks for all your suggestions! Unfortunately nothing worked so far and I have discovered that the scaling issue is caused by the type of .tif files I am using to perform the registration. Due to the large size of my scanned brain tissue slides (20x magnification) Fiji is unable to open middle brain tissue slices as a whole image. That's why I extracted single-channel DAPI.tif images from Zen blue 2.3 via Image Export -> TIFF. The export function is also restricted which is why I chose to export the single-channel DAPI.tif without compression but applying 8-bit conversion and 'shift pixels'. I ran S2V with the 8-bit images but also changing the 8-bit DAPI.tif back to 16-bit in Fiji. Scaling issue sadly remains in both cases. image When looking at the meta data of the DAPI.tif exported from ZEN I saw this: image The metrics of the image appear to be in inches. I am not sure whether the meta data of the .tif files are responsible for the scaling issue? Nevertheless, have you performed S2V registrations on brain tissue slides that have been scanned with a 20x objective? Do you have a suggestions how I can extract single-channel DAPI.tif from my big images? Thanks!

LolaaPe commented 1 year ago

Solution: https://forum.image.sc/t/splitting-large-multi-channel-czi-to-single-channel-tif/85291/2

jo-mueller commented 1 year ago

Thanks for linking the solution here @LolaaPe ! (And sorry for not getting back to your last comment, pretty swamped right now 🙈 )