DeepBleed Model

download_deepbleed_model(outdir = NULL)

load_deepbleed_model(outdir = NULL)

predict_deepbleed(image, mask = NULL, verbose = TRUE, ..., outdir = NULL)

Arguments

outdir

Output directory for `DeepBleed` model

image

image to segment using `DeepBleed` model

mask

brain mask image

verbose

print diagnostic messages

...

additional arguments to send to CT_Skull_Stripper_mask

Value

A list of the output images and predictions.

Note

https://github.com/muschellij2/deepbleed

Examples

# \donttest{ destfile = file.path(tempdir(), "01.tar.xz") dl = download.file( "https://archive.data.jhu.edu/api/access/datafile/1311?gbrecs=true", destfile = destfile)
#> Warning: URL 'https://archive.data.jhu.edu/api/access/datafile/1311?gbrecs=true': status was 'Peer certificate cannot be authenticated with given CA certificates'
#> Error in download.file("https://archive.data.jhu.edu/api/access/datafile/1311?gbrecs=true", destfile = destfile): cannot open URL 'https://archive.data.jhu.edu/api/access/datafile/1311?gbrecs=true'
res = untar(tarfile = destfile, exdir = tempdir())
#> Warning: ‘/bin/tar -xf '/tmp/Rtmp7IZWo0/01.tar.xz' -C '/tmp/Rtmp7IZWo0'’ returned error code 2
fname = file.path(tempdir(), "01", "BRAIN_1_Anonymized.nii.gz") mask = file.path(tempdir(), "01", "BRAIN_1_Anonymized_Mask.nii.gz") tdir = tempfile() dir.create(tdir) download_deepbleed_model(outdir = tdir)
#> [1] "/tmp/Rtmp7IZWo0/file295a4e6dc76e/"
mod = load_deepbleed_model(outdir = tdir)
#> Error in py_module_import(module, convert = convert): ImportError: No module named models.vnet
predict_deepbleed(fname, mask = mask, outdir = tdir)
#> Loading DeepBleed Model
#> Error in oro.nifti::readNIfTI(..., reorient = reorient): File(s) not found!
# }