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

Tiling a 3D dataset into 3D dimensional slices #4

Closed
roflmaostc opened this issue Jul 20, 2021 · 1 comment
Closed

Tiling a 3D dataset into 3D dimensional slices #4

roflmaostc opened this issue Jul 20, 2021 · 1 comment

Comments

@roflmaostc
Copy link
Member

I wanted to slice a 3D volume into tiles like:

julia> x = randn((4,4,4));

julia> tv = TiledView(x, (2,2,4), (0,0,0));

julia> size(tv) # I expected (2, 2, 4, 2, 2, 1)
(2, 2, 4, 2, 2, 2)

The resulting tv seems to access out of index regions and pads them with a default value.
Is it possible to get only a single tile in the 3rd dimension?

This also feels slightly odd:

julia> tv = TiledView(x, (2,2,1), (0,0,0)) |> size
(2, 2, 1, 2, 2, 4)

julia> tv = TiledView(x, (2,2,2), (0,0,0)) |> size
(2, 2, 2, 2, 2, 2)

julia> tv = TiledView(x, (2,2,3), (0,0,0)) |> size
(2, 2, 3, 2, 2, 2)

julia> tv = TiledView(x, (2,2,4), (0,0,0)) |> size
(2, 2, 4, 2, 2, 2)

julia> tv = TiledView(x, (2,2,5), (0,0,0)) |> size
(2, 2, 5, 2, 2, 1)

Thanks,
Felix

@RainerHeintzmann
Copy link
Member

Thanks a lot. Indeed there was a bug with the calculation of the tile center. Yet, the result in the first example is still not what you expected. It is
(2, 2, 4, 3, 3, 1)
The reason is that the TiledView tries to assure that the central tile is aligned with its central pixel to the central pixel of the parent data. If you want to start without an offset, you need to supply the argument keep_center=false.

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