Mouse-Imaging-Centre / MRIcrotome

R package for MRI data visualization
3 stars 1 forks source link

Feature request: Use bounding box of mask to determine begin/end #5

Open gdevenyi opened 5 years ago

gdevenyi commented 5 years ago

Transferring from RMINC since it will eventually use MRIcrotome under the hood: https://github.com/Mouse-Imaging-Centre/RMINC/issues/248

gdevenyi commented 5 years ago

For posterity:

xmin <- min(which(averagemask == 1, arr.ind=TRUE)[,"dim1"])
xmax <-max(which(averagemask == 1, arr.ind=TRUE)[,"dim1"])
ymin <- min(which(averagemask == 1, arr.ind=TRUE)[,"dim2"])
ymax <- max(which(averagemask == 1, arr.ind=TRUE)[,"dim2"])
zmin <- min(which(averagemask == 1, arr.ind=TRUE)[,"dim3"])
zmax <- max(which(averagemask == 1, arr.ind=TRUE)[,"dim3"])
cfhammill commented 5 years ago

Good idea, although do you think we might want to add a few voxels for padding?

gdevenyi commented 5 years ago

yeah 10v is my default padding, though it might make sense to scale that for voxel size in some way