Skip to content

Commit 8f92cdb

Browse files
committed
added support FS_names with 1 middle surf to separate infra/supra
1 parent ffb6bec commit 8f92cdb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

mri_compute_volume_fractions/mri_compute_layer_fractions.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ main(int argc, char *argv[])
168168

169169
MRIreInitCache(mri_layers) ;
170170

171-
if (FS_names && nlayers != 1)
171+
if (FS_names && nlayers > 2)
172172
ErrorExit(ERROR_UNSUPPORTED, "%s: if specifying FS_names must use -nlayers 1", Progname) ;
173173
printf("reading laminar surfaces from %s.?\n", LAMINAR_NAME) ;
174174
for (i = 0 ; i <= nlayers ; i++) {
@@ -186,8 +186,15 @@ main(int argc, char *argv[])
186186
}
187187
}
188188
} else {
189-
int req = snprintf(fname, STRLEN,
190-
"%s/%s/surf/%s.%s.%d", sdir, subject,hemi,LAMINAR_NAME,i) ;
189+
int req ;
190+
if (FS_names && i == 0)
191+
req = snprintf(fname, STRLEN, "%s/%s/surf/%s.white", sdir, subject,hemi) ;
192+
else if (FS_names && i == 2)
193+
req = snprintf(fname, STRLEN, "%s/%s/surf/%s.pial", sdir, subject,hemi) ;
194+
else if (FS_names)
195+
req = snprintf(fname, STRLEN, "%s/%s/surf/%s.%s", sdir, subject,hemi,LAMINAR_NAME) ;
196+
else
197+
req = snprintf(fname, STRLEN, "%s/%s/surf/%s.%s.%d", sdir, subject,hemi,LAMINAR_NAME,i) ;
191198
if( req >= STRLEN ) {
192199
std::cerr << __FUNCTION__ << ": Truncation on line " << __LINE__ << std::endl;
193200
}

0 commit comments

Comments
 (0)