Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DEVCONTAINER_BASE=mcr.microsoft.com/devcontainers/base:1.0.9-ubuntu-22.04
ARG DEVCONTAINER_BASE=mcr.microsoft.com/devcontainers/base:2.1.5-ubuntu24.04

FROM ${DEVCONTAINER_BASE} AS devcontainer

Expand Down
65 changes: 62 additions & 3 deletions docs/reference/gadgetron/gadgetron.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Gadgeton examples
# Gadgetron examples

[Gadgetron](https://github.com/gadgetron/gadgetron) is an open source project
for medical image reconstruction and can be used with Tyger. These examples
Expand All @@ -16,7 +16,7 @@ This will generate a `testdata.h5` file. You can then run a reconstruction with:

```bash
ismrmrd_hdf5_to_stream -i testdata.h5 --use-stdout \
| tyger run exec -f basic_gadgetron.yml \
| tyger run exec -f basic_gadgetron.yml \
| ismrmrd_stream_to_hdf5 --use-stdin -o out_basic.h5
```

Expand All @@ -26,6 +26,65 @@ ismrmrd_hdf5_to_stream -i testdata.h5 --use-stdout \
<!--@include: ./basic_gadgetron.yml-->
```

## Using dependent measurements

It is common in MRI to perform a noise reference scan before the main scan. The
noise scan is used to estimate a noise covariance matrix and the subsequent scan
is reconstructed after noise pre-whitening using this covariance matrix.

For this example, download the noise and main scan raw data files:

```bash
curl -OL https://aka.ms/tyger/docs/samples/dependencies/noise_scan.h5
curl -OL https://aka.ms/tyger/docs/samples/dependencies/main_scan.h5
```

### Compute noise covariance matrix

Start by creating buffers for the noise data and covariance matrix:

```bash
noise_buffer_id=$(tyger buffer create)
noise_covariance_buffer_id=$(tyger buffer create)
```

Then write the noise data to the buffer:

```bash
ismrmrd_hdf5_to_stream -i noise_scan.h5 --use-stdout \
| tyger buffer write $noise_buffer_id
```

Now compute the noise covariance matrix using the two buffers:

```bash
tyger run exec -f noise_gadgetron.yml \
-b input=$noise_buffer_id \
-b noisecovariance=$noise_covariance_buffer_id
```

`noise_gadgetron.yml` looks like this:
```yaml
<!--@include: ./noise_gadgetron.yml-->
```

### Reconstruction

We are ready to reconstruct the main scan data by referencing the noise
covariance matrix buffer:

```bash
ismrmrd_hdf5_to_stream -i main_scan.h5 --use-stdout \
| tyger run exec -f snr_gadgetron.yml --logs -b noisecovariance=$noise_covariance_buffer_id \
| ismrmrd_stream_to_hdf5 --use-stdin -o main-scan-recon.h5
```


`snr_gadgetron.yml` looks like this (note the two input buffers):
```yaml
<!--@include: ./snr_gadgetron.yml-->
```

## Distributed reconstruction

Next is an example that uses a distributed run. First, download the raw data:
Expand All @@ -38,7 +97,7 @@ Then run:

```bash
ismrmrd_hdf5_to_stream -i binning.h5 --use-stdout \
| tyger run exec -f distributed_gadgetron.yml --logs \
| tyger run exec -f distributed_gadgetron.yml --logs \
| ismrmrd_stream_to_hdf5 --use-stdin -o out_binning.h5
```

Expand Down
20 changes: 20 additions & 0 deletions docs/reference/gadgetron/noise_gadgetron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
job:
codespec:
image: ghcr.io/gadgetron/gadgetron/gadgetron_ubuntu_rt_nocuda:latest
buffers:
inputs:
- input
outputs:
- noisecovariance
args:
- "-c"
- "default_measurement_dependencies.xml"
- "--from_stream"
- "-i"
- "$(INPUT_PIPE)"
- "-o"
- /dev/null
- --disable_storage
- 'true'
- --parameter
- noisecovarianceout=$(NOISECOVARIANCE_PIPE)
21 changes: 21 additions & 0 deletions docs/reference/gadgetron/snr_gadgetron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
job:
codespec:
image: ghcr.io/gadgetron/gadgetron/gadgetron_ubuntu_rt_nocuda:latest
buffers:
inputs:
- input
- noisecovariance
outputs:
- output
args:
- "-c"
- "Generic_Cartesian_FFT.xml"
- "--from_stream"
- "-i"
- "$(INPUT_PIPE)"
- "-o"
- "$(OUTPUT_PIPE)"
- --disable_storage
- 'true'
- --parameter
- noisecovariancein=$(NOISECOVARIANCE_PIPE)
Loading