Skip to content

Commit 7934f74

Browse files
committed
new dset example
1 parent 8a8ea43 commit 7934f74

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

nifti2/nifti_tool.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,11 @@ static const char * g_history[] =
196196
"2.10 27 Aug 2020 [rickr]\n",
197197
" - nt_image_read() takes a new make_ver parameter\n",
198198
" - possibly convert default NIFTI-2 MAKE_IM result to NIFTI-1\n"
199+
"2.11 29 Dec 2020 [rickr] - add example to create dset from raw data\n",
199200
"----------------------------------------------------------------------\n"
200201
};
201-
static char g_version[] = "2.10";
202-
static char g_version_date[] = "August 27, 2020";
202+
static char g_version[] = "2.11";
203+
static char g_version_date[] = "December 29, 2020";
203204
static int g_debug = 1;
204205

205206
#define _NIFTI_TOOL_C_
@@ -1159,6 +1160,18 @@ int use_full()
11591160
" -new_dims 3 10 20 30 0 0 0 0 \\\n"
11601161
" -prefix new_desc.nii -infiles MAKE_IM\n"
11611162
"\n");
1163+
printf("\n"
1164+
" 4. Given a raw data file VALS.dat of 80x40x20 floats, with\n"
1165+
" grid spacing 0.5mm x 1mm x 2mm, make a 2-file NIFTI dataset\n"
1166+
" and overwrite the all-zero data with 'VALS.dat'.\n"
1167+
" Use -mod_hdr to specify that the output type is 2-files.\n\n"
1168+
" nifti_tool -infiles MAKE_IM -prefix newdata.hdr \\\n"
1169+
" -new_dims 3 80 40 20 0 0 0 0 \\\n"
1170+
" -new_datatype 16 \\\n"
1171+
" -mod_hdr -mod_field pixdim '1 0.5 1 2 1 1 1 1' \\\n"
1172+
" -mod_hdr -mod_field magic ni1\n\n"
1173+
" cp VALS.dat newdata.img\n"
1174+
"\n");
11621175
printf(
11631176
" E. copy dataset, brick list or collapsed image:\n"
11641177
"\n"

0 commit comments

Comments
 (0)