Skip to content

Commit c743d70

Browse files
committed
Improve documentation
1 parent e81b2d5 commit c743d70

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Likewise, if you are compiling on Windows using cmake:
4949
```
5050
git clone https://github.com/rordenlab/niimath.git
5151
cd niimath & mkdir build & cd build & cmake ..
52-
msbuild niimath.sln
52+
cmake --build .
5353
```
5454
Alternatively, you can compile the software by running the terminal command `make` from the project's `src` folder if you are running Linux (or execute `windows.bat` if you are running Windows):
5555

library/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## About
22

3-
`niimath` is a high-performance command-line tool for manipulating NIfTI images. Because `niimath` is so fast, the main bottleneck in many workflows is disk I/O. To enable efficient workflows, niimath supports reading from and writing to standard input/output streams using the special filename `-`.
3+
`niimath` is a high-performance command-line tool for manipulating NIfTI images. Because `niimath` is so fast, the main bottleneck in many workflows is disk I/O. To enable efficient workflows, niimath supports reading from and writing to standard input/output streams using the special filename `-`. It is important to note that both the input and output must be single-file NIfTI-1 images (e.g. `img.nii`). Compressed files (e.g. `img.nii.gz`) must be decompressed prior to using the memory stream input.
44

55
This streaming capability is especially useful for chaining tools together without writing intermediate results to disk. For example:
66

@@ -31,4 +31,11 @@ python read_stdin.py
3131

3232
# Pipe a NIfTI image to niimath and capture the output via stdout, fully in memory
3333
python read_write_stream.py
34+
35+
# Use nibabel to_bytes() and from_bytes() to call niimath using pipes
36+
python nibabel_niimath.py
3437
```
38+
39+
## Limitations
40+
41+
These features are currently only supported on Unix operating systems (Linux and MacOS). Memory piping works differently on Windows computers.

src/niftilib/nifti2_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5682,7 +5682,7 @@ nifti_image *nifti_image_read( const char *hname , int read_data )
56825682
/**- read the data if desired, then bug out */
56835683
if( read_data ){
56845684
if (isStdIn) {
5685-
nim->iname = strdup("-");
5685+
nim->iname = nifti_strdup("-");
56865686
if (ni_ver != 1) {
56875687
fprintf(stderr,"piped input only supports NIFTI-1\n");
56885688
return NULL;

0 commit comments

Comments
 (0)