ggseg / ggsegExtra

Repository for extra atlases for the ggseg-package
https://ggseg.github.io/ggsegExtra/
Other
52 stars 18 forks source link

make_ggseg3d_2_2_ggseg: error in evaluating the argument 'x' in selecting a method for function 'cellStats': subscript out of bounds #37

Open johnaeanderson opened 3 years ago

johnaeanderson commented 3 years ago

Hi Dr. Mowinckel,

I've tried to convert the 3D ICBM atlas to 2D using the code below. I've run into a few errors I'm not sure how to debug (but am hoping you have a better idea of what they mean).

Just to make sure the example works, I also ran test <- make_ggseg3d_2_ggseg() which uses the dk by default - this seems to work & I was able to plot the results just fine.

I'd appreciate any insight,

Best wishes,

John

make_ggseg3d_2_ggseg( ggseg3d_atlas = icbm_3d, steps = 1:7, output_dir = "/Users/john/Desktop/icbm", tolerance = 0, smoothness = 5, cleanup = FALSE, ncores = parallel::detectCores() - 2 ) • 1/7 Snapshotting views of entire atlas to /Users/john/Desktop/icbm/icbm ✓ Snapshots complete • 2/7 Snapshotting individual regions to /Users/john/Desktop/icbm/icbm/img ✓ Region snapshots complete • 3/7 Isolating regions to /Users/john/Desktop/icbm/icbm/masks • & writing masks to /Users/john/Desktop/icbm/icbm/regions ✓ isolation complete • 4/7 Extracting contours from regions Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'cellStats': subscript out of bounds In addition: Warning messages: 1: In mclapply(seq_len(n), do_one, mc.preschedule = mc.preschedule, : all scheduled cores encountered errors in user code 2: In mclapply(seq_len(n), do_one, mc.preschedule = mc.preschedule, : all scheduled cores encountered errors in user code

drmowinckels commented 3 years ago

Hi!

Sorry for the late response. The ICBM is a subcortical atlas, and as such cannot be created into 2d from the 3d-atlas. Only the cortical atlases can do this (because they are inflated). To create the ICBM in 2d, you will need to use the make_volumetric_ggseg()

Here is some information about using that function. You will need the original ICBM atlas file to make this work. https://ggseg.github.io/ggsegExtra/articles/createaseg.html