@@ -348,7 +348,7 @@ void mcx_clearcfg(Config *cfg){
348
348
349
349
void mcx_savenii (float * dat , size_t len , char * name , int type32bit , int outputformatid , Config * cfg ){
350
350
FILE * fp ;
351
- char fname [MAX_PATH_LENGTH ]= {'\0' };
351
+ char fname [MAX_FULL_PATH ]= {'\0' };
352
352
nifti_1_header hdr ;
353
353
nifti1_extender pad = {{0 ,0 ,0 ,0 }};
354
354
float * logval = dat ;
@@ -434,8 +434,8 @@ void mcx_savenii(float *dat, size_t len, char* name, int type32bit, int outputfo
434
434
435
435
void mcx_savedata (float * dat , size_t len , Config * cfg ){
436
436
FILE * fp ;
437
- char name [MAX_PATH_LENGTH ];
438
- char fname [MAX_PATH_LENGTH ];
437
+ char name [MAX_FULL_PATH ];
438
+ char fname [MAX_FULL_PATH ];
439
439
unsigned int glformat = GL_RGBA32F ;
440
440
441
441
if (cfg -> rootpath [0 ])
@@ -473,7 +473,7 @@ void mcx_savedata(float *dat, size_t len, Config *cfg){
473
473
474
474
void mcx_savedetphoton (float * ppath , void * seeds , int count , int doappend , Config * cfg ){
475
475
FILE * fp ;
476
- char fhistory [MAX_PATH_LENGTH ], filetag ;
476
+ char fhistory [MAX_FULL_PATH ], filetag ;
477
477
filetag = ((cfg -> his .detected == 0 && cfg -> his .savedphoton ) ? 't' : 'h' );
478
478
if (cfg -> rootpath [0 ])
479
479
sprintf (fhistory ,"%s%c%s.mc%c" ,cfg -> rootpath ,pathsep ,cfg -> session ,filetag );
@@ -600,11 +600,11 @@ void mcx_error(const int id,const char *msg,const char *file,const int linenum){
600
600
#ifdef MCX_CONTAINER
601
601
mcx_throw_exception (id ,msg ,file ,linenum );
602
602
#else
603
- MCX_FPRINTF (stdout ,S_RED "\nMCX ERROR(%d):%s in unit %s:%d\n" S_RESET ,id ,msg ,file ,linenum );
603
+ MCX_FPRINTF (stdout ,S_RED "\nMCX ERROR(%d):%s in unit %s:%d\n" S_RESET ,id ,msg ,file ,linenum );
604
604
if (id == - CUDA_ERROR_LAUNCH_FAILED ){
605
- MCX_FPRINTF (stdout ,S_RED "MCX is terminated by your graphics driver. If you use windows, \n\
605
+ MCX_FPRINTF (stdout ,S_RED "MCX is terminated by your graphics driver. If you use windows, \n\
606
606
please modify TdrDelay value in the registry. Please checkout FAQ #1 for more details:\n\
607
- URL: http://mcx.space/wiki/index.cgi?Doc/FAQ\n" S_RESET );
607
+ URL: http://mcx.space/wiki/index.cgi?Doc/FAQ\n" S_RESET );
608
608
}
609
609
exit (id );
610
610
#endif
@@ -780,7 +780,7 @@ void mcx_prepdomain(char *filename, Config *cfg){
780
780
if (cfg -> seed == SEED_FROM_FILE && cfg -> seedfile [0 ]){
781
781
if (cfg -> respin > 1 || cfg -> respin < 0 ){
782
782
cfg -> respin = 1 ;
783
- fprintf (stderr ,S_RED "WARNING: respin is disabled in the replay mode\n" S_RESET );
783
+ fprintf (stderr ,S_RED "WARNING: respin is disabled in the replay mode\n" S_RESET );
784
784
}
785
785
mcx_loadseedfile (cfg );
786
786
}
@@ -847,7 +847,7 @@ void mcx_loadconfig(FILE *in, Config *cfg){
847
847
uint i ,gates ,itmp ;
848
848
size_t count ;
849
849
float dtmp ;
850
- char filename [MAX_PATH_LENGTH ]= {'\0' }, comment [MAX_PATH_LENGTH ],strtypestr [MAX_SESSION_LENGTH ]= {'\0' },* comm ;
850
+ char filename [MAX_FULL_PATH ]= {'\0' }, comment [MAX_FULL_PATH ],strtypestr [MAX_FULL_PATH ]= {'\0' },* comm ;
851
851
852
852
if (in == stdin )
853
853
fprintf (stdout ,"Please specify the total number of photons: [1000000]\n\t" );
@@ -1074,7 +1074,7 @@ void mcx_loadconfig(FILE *in, Config *cfg){
1074
1074
int mcx_loadjson (cJSON * root , Config * cfg ){
1075
1075
int i ;
1076
1076
cJSON * Domain , * Optode , * Forward , * Session , * Shapes , * tmp , * subitem ;
1077
- char filename [MAX_PATH_LENGTH ]= {'\0' };
1077
+ char filename [MAX_FULL_PATH ]= {'\0' };
1078
1078
Domain = cJSON_GetObjectItem (root ,"Domain" );
1079
1079
Optode = cJSON_GetObjectItem (root ,"Optode" );
1080
1080
Session = cJSON_GetObjectItem (root ,"Session" );
@@ -1733,7 +1733,7 @@ void mcx_maskdet(Config *cfg){
1733
1733
}
1734
1734
}
1735
1735
if (cfg -> issavedet && count == 0 )
1736
- MCX_FPRINTF (stderr ,S_RED "WARNING: detector %d is not located on an interface, please check coordinates.\n" S_RESET ,d + 1 );
1736
+ MCX_FPRINTF (stderr ,S_RED "WARNING: detector %d is not located on an interface, please check coordinates.\n" S_RESET ,d + 1 );
1737
1737
}
1738
1738
1739
1739
free (padvol );
@@ -1752,7 +1752,7 @@ void mcx_maskdet(Config *cfg){
1752
1752
*/
1753
1753
1754
1754
void mcx_dumpmask (Config * cfg ){
1755
- char fname [MAX_PATH_LENGTH ];
1755
+ char fname [MAX_FULL_PATH ];
1756
1756
if (cfg -> rootpath [0 ])
1757
1757
sprintf (fname ,"%s%c%s_vol" ,cfg -> rootpath ,pathsep ,cfg -> session );
1758
1758
else
@@ -1799,7 +1799,7 @@ void mcx_progressbar(float percent, Config *cfg){
1799
1799
for (j = 0 ;j < percentage ;j ++ ) MCX_FPRINTF (stdout ,"=" );
1800
1800
MCX_FPRINTF (stdout ,(percentage < colwidth - 18 ) ? ">" : "=" );
1801
1801
for (j = percentage ;j < colwidth - 18 ;j ++ ) MCX_FPRINTF (stdout ," " );
1802
- MCX_FPRINTF (stdout ,"] %3d%%" S_RESET ,(int )(percent * 100 ));
1802
+ MCX_FPRINTF (stdout ,"] %3d%%" S_RESET ,(int )(percent * 100 ));
1803
1803
#ifdef MCX_CONTAINER
1804
1804
mcx_matlab_flush ();
1805
1805
#else
@@ -2296,7 +2296,7 @@ void mcx_printheader(Config *cfg){
2296
2296
# The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365 #\n\
2297
2297
###############################################################################\n\
2298
2298
$Rev:: $2019.4 $Date:: $ by $Author:: $\n\
2299
- ###############################################################################\n" S_RESET );
2299
+ ###############################################################################\n" S_RESET );
2300
2300
}
2301
2301
2302
2302
/**
@@ -2312,10 +2312,10 @@ void mcx_usage(Config *cfg,char *exename){
2312
2312
usage: %s <param1> <param2> ...\n\
2313
2313
where possible parameters include (the first value in [*|*] is the default)\n\
2314
2314
\n" S_BOLD S_CYAN "\
2315
- == Required option ==\n" S_RESET "\
2315
+ == Required option ==\n" S_RESET "\
2316
2316
-f config (--input) read an input file in .json or .inp format\n\
2317
2317
\n" S_BOLD S_CYAN "\
2318
- == MC options ==\n" S_RESET "\
2318
+ == MC options ==\n" S_RESET "\
2319
2319
-n [0|int] (--photon) total photon number (exponential form accepted)\n\
2320
2320
max accepted value:9.2234e+18 on 64bit systems\n\
2321
2321
-r [1|+/-int] (--repeat) if positive, repeat by r times,total= #photon*r\n\
@@ -2350,7 +2350,7 @@ where possible parameters include (the first value in [*|*] is the default)\n\
2350
2350
-e [0.|float] (--minenergy) minimum energy level to terminate a photon\n\
2351
2351
-g [1|int] (--gategroup) number of time gates per run\n\
2352
2352
\n" S_BOLD S_CYAN "\
2353
- == GPU options ==\n" S_RESET "\
2353
+ == GPU options ==\n" S_RESET "\
2354
2354
-L (--listgpu) print GPU information only\n\
2355
2355
-t [16384|int](--thread) total thread number\n\
2356
2356
-T [64|int] (--blocksize) thread number per block\n\
@@ -2361,7 +2361,7 @@ where possible parameters include (the first value in [*|*] is the default)\n\
2361
2361
-W '50,30,20' (--workload) workload for active devices; normalized by sum\n\
2362
2362
-I (--printgpu) print GPU information and run program\n\
2363
2363
\n" S_BOLD S_CYAN "\
2364
- == Input options ==\n" S_RESET "\
2364
+ == Input options ==\n" S_RESET "\
2365
2365
-P '{...}' (--shapes) a JSON string for additional shapes in the grid\n\
2366
2366
-K [1|int|str](--mediabyte) volume data format, use either a number or a str\n\
2367
2367
1 or byte: 0-128 tissue labels\n\
@@ -2374,7 +2374,7 @@ where possible parameters include (the first value in [*|*] is the default)\n\
2374
2374
104 or muamus_short: 2x short gray-levels for mua/s\n\
2375
2375
-a [0|1] (--array) 1 for C array (row-major); 0 for Matlab array\n\
2376
2376
\n" S_BOLD S_CYAN "\
2377
- == Output options ==\n" S_RESET "\
2377
+ == Output options ==\n" S_RESET "\
2378
2378
-s sessionid (--session) a string to label all output file names\n\
2379
2379
-O [X|XFEJPM] (--outputtype) X - output flux, F - fluence, E - energy deposit\n\
2380
2380
/case insensitive/ J - Jacobian (replay mode), P - scattering, \n\
@@ -2409,21 +2409,21 @@ where possible parameters include (the first value in [*|*] is the default)\n\
2409
2409
hdr - Analyze 7.5 hdr/img format\n\
2410
2410
tx3 - GL texture data for rendering (GL_RGBA32F)\n\
2411
2411
\n" S_BOLD S_CYAN "\
2412
- == User IO options ==\n" S_RESET "\
2412
+ == User IO options ==\n" S_RESET "\
2413
2413
-h (--help) print this message\n\
2414
2414
-v (--version) print MCX revision number\n\
2415
2415
-l (--log) print messages to a log file instead\n\
2416
2416
-i (--interactive) interactive mode\n\
2417
2417
\n" S_BOLD S_CYAN "\
2418
- == Debug options ==\n" S_RESET "\
2418
+ == Debug options ==\n" S_RESET "\
2419
2419
-D [0|int] (--debug) print debug information (you can use an integer\n\
2420
2420
or or a string by combining the following flags)\n\
2421
2421
-D [''|RMP] 1 R debug RNG\n\
2422
2422
/case insensitive/ 2 M store photon trajectory info\n\
2423
2423
4 P print progress bar\n\
2424
2424
combine multiple items by using a string, or add selected numbers together\n\
2425
2425
\n" S_BOLD S_CYAN "\
2426
- == Additional options ==\n" S_RESET "\
2426
+ == Additional options ==\n" S_RESET "\
2427
2427
--root [''|string] full path to the folder storing the input files\n\
2428
2428
--gscatter [1e9|int] after a photon completes the specified number of\n\
2429
2429
scattering events, mcx then ignores anisotropy g\n\
@@ -2437,14 +2437,14 @@ where possible parameters include (the first value in [*|*] is the default)\n\
2437
2437
stored (default: 1e7)\n\
2438
2438
--faststep [0|1] 1-use fast 1mm stepping, [0]-precise ray-tracing\n\
2439
2439
\n" S_BOLD S_CYAN "\
2440
- == Example ==\n" S_RESET "\
2440
+ == Example ==\n" S_RESET "\
2441
2441
example: (autopilot mode)\n" S_GREEN "\
2442
- %s -A 1 -n 1e7 -f input.inp -G 1 -D P\n" S_RESET "\
2442
+ %s -A 1 -n 1e7 -f input.inp -G 1 -D P\n" S_RESET "\
2443
2443
or (manual mode)\n" S_GREEN "\
2444
- %s -t 16384 -T 64 -n 1e7 -f input.inp -s test -r 2 -g 10 -d 1 -w dpx -b 1 -G 1\n" S_RESET "\
2444
+ %s -t 16384 -T 64 -n 1e7 -f input.inp -s test -r 2 -g 10 -d 1 -w dpx -b 1 -G 1\n" S_RESET "\
2445
2445
or (use multiple devices - 1st,2nd and 4th GPUs - together with equal load)\n" S_GREEN "\
2446
- %s -A -n 1e7 -f input.inp -G 1101 -W 10,10,10\n" S_RESET "\
2446
+ %s -A -n 1e7 -f input.inp -G 1101 -W 10,10,10\n" S_RESET "\
2447
2447
or (use inline domain definition)\n" S_GREEN "\
2448
- %s -f input.json -P '{\"Shapes\":[{\"ZLayers\":[[1,10,1],[11,30,2],[31,60,3]]}]}'" S_RESET "\n" ,
2448
+ %s -f input.json -P '{\"Shapes\":[{\"ZLayers\":[[1,10,1],[11,30,2],[31,60,3]]}]}'" S_RESET "\n" ,
2449
2449
exename ,exename ,exename ,exename ,exename );
2450
2450
}
0 commit comments