-
Notifications
You must be signed in to change notification settings - Fork 18
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
Question about ImageStackDataset #36
Comments
Yes, that's intentional. The idea in I hope this answers your questions; if not it would be helpful to have a small example that shows how things are going wrong for your use case. |
My use case is that I have 3D + time data and I'm trying to process it as 2D slices. I'm trying to use as below, it is working after I changed the model = UNet2d(in_channels=1, out_channels=2)
path = Path('<my directory>')
images_key = 'images'
labels_key = 'labels'
label_transform = torch_em.transform.BoundaryTransform(
add_binary_target=True, ndim=2
)
def transform(x, y):
return x.squeeze(), y.squeeze()
# training and validation data loader
train_loader = torch_em.default_segmentation_loader(
str(path / images_key), "*.tif",
str(path / labels_key), "*.tif",
batch_size=16, patch_shape=(1, 1, 256, 256),
transform=transform,
label_transform2=label_transform,
n_samples=250,
ndim=2,
) Without the Removing the array and patch shape assertion and using the 4-dimensional patch also works. |
Ok, I see. This probably happens because I haven't taken 4D datasets into account. I don't have much time to look into this right now, but it looks like removing the assertion fixes the issue for you for now. |
Thanks, I will do that :) |
I was playing with torch-em and I had some issues regarding the shape of the images.
I noticed that the number of dimensions is fixed to 3 when using the ImageStackDataset.
elf/elf/io/image_stack_wrapper.py
Line 99 in 301482b
Is this intentional? When I changed to the length of the shape my script worked.
Thanks in advance,
The text was updated successfully, but these errors were encountered: