muschellij2 / lungct

Segmentation and Analysis of Lung CT scans
15 stars 8 forks source link

Download mask #7

Open AndreaL2 opened 2 years ago

AndreaL2 commented 2 years ago

Hi. I’m using lungct to obtain masks from images and RIA to compute radiomics features. In RIA to compute the radiomic features I need to specify the file path of the dcm image and the file path of the mask. I have tried the RIA_lung() but it doesn't work. How can I download the mask that I created with lungct to use it with the RIA library? Thanks

muschellij2 commented 2 years ago

What do you mean "it doesn't work"? Can you provide a minimal example: https://stackoverflow.com/help/minimal-reproducible-example

See https://github.com/muschellij2/lungct#radiomics for how the RIA_lung function is used.

AndreaL2 commented 2 years ago

I am using the following code to create a mask from an image:

res <- dcm2niir::dcm2nii(basedir="/Users/images/11") # convert dcm to nii checked <- check_dcm2nii(res) image <- antsImageRead(checked) image <- ANTsRCore::antsImageRead(checked) mask <- segment_lung(image) # create mask

And this to compute the radiomic features:

RIA_lung( # radiomic features image, mask, sides = c("right", "left"), features = c("fo", "glcm"), bins_in = 16, equal_prob = FALSE, distance = 1, statistic = "mean(X, na.rm = TRUE)")

I get the following error:

Error in FUN(X[[i]], ...) : 'list' object cannot be coerced to type 'double'

Thanks.

muschellij2 commented 2 years ago

I believe the output of segment_lung is a list, not an image. Make sure that it's an image.

AndreaL2 commented 2 years ago

Ok, thanks.