Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in blending images tile is missing #198

Open
ViriatoII opened this issue Aug 22, 2023 · 1 comment
Open

Error in blending images tile is missing #198

ViriatoII opened this issue Aug 22, 2023 · 1 comment

Comments

@ViriatoII
Copy link

ViriatoII commented Aug 22, 2023

Hey,

I'm calling Ashlar with a Python wrapper for a set of tiff files in a folder. It fails if one tile is missing.

Traceback (most recent call last):
File "C:\Users\ricardo.guerreiro\Experiments\24_stitching\run_ashlar.py", line 110, in
aligner0.run()
File "C:\Users\ricardo.guerreiro\Experiments\pipelines\ashlar\ashlar\reg.py", line 550, in run
self.make_thumbnail()
File "C:\Users\ricardo.guerreiro\Experiments\pipelines\ashlar\ashlar\reg.py", line 562, in make_thumbnail
self.reader.thumbnail = thumbnail.make_thumbnail(
File "C:\Users\ricardo.guerreiro\Experiments\pipelines\ashlar\ashlar\thumbnail.py", line 41, in make_thumbnail
utils.paste(mosaic, img_s, pos_s, utils.pastefunc_blend)
File "C:\Users\ricardo.guerreiro\Experiments\pipelines\ashlar\ashlar\utils.py", line 181, in paste
target_slice[:] = func(target_slice, img)
File "C:\Users\ricardo.guerreiro\Experiments\pipelines\ashlar\ashlar\utils.py", line 207, in pastefunc_blend
alpha[skimage.morphology.binary_dilation(img == 0)] = 1
IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed

So my tiles now are in this disposition:
1_2_3_4
5___7_8

My tile 6 is missing, it could not be created. Ashlar should have a mechanism of ignoring a missing tile and jumping to the next one.

This is the code I'm using:

    for i in range(3):
        readers.append(fileseries.FileSeriesReader(
            my_data_folder,                            
            pattern='my_images_*{series:1}.ome.tiff',
            overlap=0.01, #.1,
            width= len(rows),
            height=len(cols),
            layout='raster',
            direction='horizontal', )
        )

    aligner0 = reg.EdgeAligner(readers[0], channel=0, 
                            filter_sigma=15, verbose=True)
    aligner0.run()

    mosaic_args = {}
    mosaic_args['verbose'] = True
    mosaic_args['flip_mosaic_y'] = False 
    mosaic_args['channels'] = [20] #,22]
    aligners = []
    aligners.append(aligner0)


    mosaics = []
    for j in range(1, 2):
        aligners.append(
            reg.LayerAligner(readers[j], aligners[0], channel=j, filter_sigma=15, verbose=True)
        )
        aligners[j].run()

        mosaic = reg.Mosaic(
            aligners[j], aligners[0].mosaic_shape, **mosaic_args
        )
        mosaics.append(mosaic)
    ```
@jmuhlich
Copy link
Collaborator

Yes, the fileseries reader is not fully ready for general use yet. Handling of missing tiles is one thing it could do better.

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

No branches or pull requests

2 participants