-
Notifications
You must be signed in to change notification settings - Fork 240
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
Add CropOrPadAtCenter transform class #1233
Comments
Hi here is a code exemple:
Does will suite your needs ? |
I see, yes that would work for what I'm looking for. May need some additional code to ensure that I'm getting all voxels in the sampled image ,but this is basically what I want. |
what do you mean by all voxel ? You will get only voxel that are less than patch_size/2 away from the center |
to ensure that the sampled patch contains all positive voxels in the label. i guess the difference here is that i'm specifying the center so there is more control over where the sample is getting drawn from, which is important for my use case |
🚀 Feature
A crop or pad function that allows the user to crop/pad an image but specify where the center of the new image should be based on the input image. For example, let's say I have an organ centered at location
[45,62,101]
in a volume that is[368, 512, 128]
in size and I want my new image to be[128,128,128]
in size, and the center of the new image (i.e.[64,64,64]
) to map to the point[45,62,101]
in the original image.Motivation
Developing datasets with tumors, need to crop and pad around the tumors.
Pitch
Described above. Proposed code below.
Alternatives
N/A
Additional context
Here is my proposed code. I've tested it locally but probably need more robust testing.
The text was updated successfully, but these errors were encountered: