@@ -168,7 +168,7 @@ main(int argc, char *argv[])
168
168
169
169
MRIreInitCache (mri_layers) ;
170
170
171
- if (FS_names && nlayers != 1 )
171
+ if (FS_names && nlayers > 2 )
172
172
ErrorExit (ERROR_UNSUPPORTED, " %s: if specifying FS_names must use -nlayers 1" , Progname) ;
173
173
printf (" reading laminar surfaces from %s.?\n " , LAMINAR_NAME) ;
174
174
for (i = 0 ; i <= nlayers ; i++) {
@@ -186,8 +186,15 @@ main(int argc, char *argv[])
186
186
}
187
187
}
188
188
} 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) ;
191
198
if ( req >= STRLEN ) {
192
199
std::cerr << __FUNCTION__ << " : Truncation on line " << __LINE__ << std::endl;
193
200
}
0 commit comments