Skip to content

Commit 99d1742

Browse files
committed
docs
1 parent 6f65e75 commit 99d1742

20 files changed

+1621
-444
lines changed

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ S3method(run_regional,feature_rsa_model)
6969
S3method(run_regional,mvpa_model)
7070
S3method(run_regional,rsa_model)
7171
S3method(run_searchlight,default)
72+
S3method(run_searchlight,feature_rsa_model)
7273
S3method(run_searchlight,vector_rsa)
7374
S3method(select_features,FTest)
7475
S3method(select_features,catscore)

R/dataset.R

+16-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ gen_sample_dataset <- function(D, nobs, response_type=c("categorical", "continuo
101101
dset <- mvpa_dataset(train_data=bvec,mask=mask)
102102
}
103103
} else {
104-
fname <- system.file("extdata/std.lh.smoothwm.asc", package="neuroim2")
104+
fname <- system.file("extdata/std.8_lh.inflated.asc", package="neurosurf")
105105
geom <- neurosurf::read_surf_geometry(fname)
106106
nvert <- nrow(neurosurf::vertices(geom))
107107
mat <- matrix(rnorm(nvert*nobs), nvert, nobs)
@@ -181,6 +181,21 @@ mvpa_dataset <- function(train_data, test_data=NULL, mask) {
181181
}
182182
assert_that(inherits(mask, "NeuroVol"))
183183

184+
# Check for single-voxel datasets (1,1,1,time)
185+
mask_dims <- dim(mask)[1:3]
186+
total_voxels <- prod(mask_dims)
187+
if (total_voxels <= 1) {
188+
stop("Invalid dataset: Only 1 voxel detected (dimensions ",
189+
paste(mask_dims, collapse="×"),
190+
"). Feature RSA analysis requires multiple voxels.")
191+
}
192+
193+
# Check for active voxels in mask
194+
active_voxels <- sum(mask > 0)
195+
if (active_voxels <= 1) {
196+
stop("Invalid dataset: Only ", active_voxels, " active voxel(s) in mask. Feature RSA analysis requires multiple active voxels.")
197+
}
198+
184199
ret <- structure(
185200
list(
186201
train_data=train_data,

0 commit comments

Comments
 (0)