Skip to content

Can I save to .nii.gz by torchio easily after preprocess? #731

Answered by Bigsealion
Bigsealion asked this question in Q&A
Discussion options

You must be logged in to vote

When I read the document, I have a new question, and the above solution did not work

The following code is from the document, and I want to know how to save the output image

# Transforms can be composed as in torchvision.transforms
transforms = [rescale, spatial]
transform = tio.Compose(transforms)
# SubjectsDataset is a subclass of torch.data.utils.Dataset
subjects_dataset = tio.SubjectsDataset(subjects_list, transform=transform)

# Images are processed in parallel thanks to a PyTorch DataLoader
training_loader = DataLoader(subjects_dataset, batch_size=4, num_workers=4)

# Training epoch
for subjects_batch in training_loader:
    inputs = subjects_batch['t1'][tio.DATA]
    target = subje…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@Bigsealion
Comment options

@Bigsealion
Comment options

Comment options

You must be logged in to vote
5 replies
@romainVala
Comment options

@fepegar
Comment options

@Bigsealion
Comment options

@fepegar
Comment options

@Bigsealion
Comment options

Answer selected by Bigsealion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants