ANTsPyNet icon indicating copy to clipboard operation
ANTsPyNet copied to clipboard

image reconstruction with masked patches

Open stnava opened this issue 3 years ago • 2 comments

import ants
x = ants.image_read(ants.get_ants_data('r16'))
mask=ants.get_mask( x )
patches = antspynet.extract_image_patches(x, patch_size=tuple([32,32]),
    max_number_of_patches=int(mask.sum()), return_as_array=False,
    mask_image=mask, randomize=False )
reconstructed_image = antspynet.reconstruct_image_from_patches(
  patches, mask, domain_image_is_mask=True )

the above fails

import ants
import antspynet
x = ants.image_read(ants.get_ants_data('r16'))
mask=ants.get_mask( x )
patches = antspynet.extract_image_patches(x, patch_size=tuple([32,32]),
    max_number_of_patches=int(mask.sum()), return_as_array=False,
    mask_image=mask, randomize=False )
reconstructed_image = antspynet.reconstruct_image_from_patches(
   patches, mask, domain_image_is_mask=True, stride_length=2 )

this runs but produces junk ... is this repairable?

stnava avatar Jan 16 '22 16:01 stnava

I have a fix - it just seems slow .... let me test further - will push to my pull request if it goes ok

stnava avatar Jan 16 '22 18:01 stnava

Awesome. Let me know if you need me to take a look.

ntustison avatar Jan 16 '22 20:01 ntustison