update on gadgetron - ccp pet-mr · 2018-07-23 · gadgetron framework architecture, data types,...

33
Update on Gadgetron July 2018 Hui Xue 1 , David Hansen 2 National Heart, Lung, and Blood Institute Gradient Software https://github.com/gadgetron/gadgetron

Upload: others

Post on 24-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Update on Gadgetron July 2018

Hui Xue1, David Hansen2

National Heart, Lung, and Blood Institute

Gradient Software

https://github.com/gadgetron/gadgetron

Page 2: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron framework

Architecture, Data types,

Functionalities and toolboxes

Deployment and Integration test

Generic chain

Enable flexible triggering

ISMRMRD

Waveform, c++/python/matlab

Recent developments

Cloud computing in Gadgetron

Built-in Machine learning

Future plans

….

2

Outline

Page 3: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Overview

3

GADGETRON

Page 4: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron

4

• Started by Michael Hansen and Thomas Sørensen in 2010

• Aim to provide flexibility, development efficiency, robust deployment and

computing power to medical imaging research

• A place to accommodate

algorithms, clinical applications, testing and deployment …

in a reusable way

Page 5: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron – Developer’s view

5

Gadget 1 Gadget 2 Gadget 3

GadgetSt ream Cont roller

Reader 1

Reader 2

Reader 3

Writer 1

Writer 2

Writer 3

Message

Dispatch

Message ID?

Output

Queue

Message ID?

Socket

TCP/IP

CLIENT

APPLICATION

Shared Toolboxes

GADGETRON

Gadget can be coded by C++/Matlab/Python

Developer can write every processing unit -> Gadgets

Developer fully controls the data passing between gadgets

Page 6: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron – End User’s view

6

MARS External Gadgetron HostTCP/IP

ICE

MARS

Conta inerized Gadgetr on

(chroot)

TCP/IP

ICE

MARS

Cloud Ga dgetron Host

SSH

ICE

100%

software

solution

MARS External Gadgetron HostTCP/IP

ICE

MARS

Conta inerized Gadgetr on

(chroot)

TCP/IP

ICE

MARS

Cloud Ga dgetron Host

SSH

ICE

MARS External Gadgetron HostTCP/IP

ICE

MARS

Conta inerized Gadgetr on

(chroot)

TCP/IP

ICE

MARS

Cloud Ga dgetron Host

SSH

ICE

Gadgetron processing is transparent to end user

Page 7: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Functionalities in toolboxes

Clinical applications (e.g. Cine: RealTime, Compressed sensing

T1/T2/T2* mapping

Fat-water separation

Cloud applications)

General algorithms

(e.g. KLT, Bspline, optimization for L1 norm, motion correction)

Basic data structures (array, matrix, image…)

Math (FFT, matrix/vector, …)

Application specific

algorithms

(e.g. epi correction, graph-cut fat water,

grappa, spirit)

Interfaces (to/from python, matlab)

Software infrastructure

Cross-platform compilation (linux, windows, mac)

Integration test, online

Docker based deployment

Live in open-source world

Data format (hdf5, Analyze …)

Page 8: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Commit

changes

8

Continuous development and global

deployment Every code changes has been tested before deployed in cloud

• Github, https://github.com/gadgetron/gadgetron

• Integration test, http://gtbuildbot.eastus.cloudapp.azure.com:8010/#/

Github Buildbot calls up

the integration test

Trigger

Windows

Linux

MacBook

Integration tests

on comprehensive

testing datasets

success

success

success

Docker

image

Fast global deployment of new technology

Page 9: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron Deployment

map Users

Planned

London

2

1

2 2 3

5 1

22 sites

44 scanners

Page 10: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

10

Generic recon chain in Gadgetron

Page 11: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron – Generic chain

11

• What are the motivation?

Consolidate different gadgets for MR recon

Uniform “language” to specify technical “details” when we discuss MR

reconstruction

Support different clinical use cases and remains to be flexible,

configurable, high-performance

• What will this offer?

A set of common data structures

A set of gadgets following consistent convention

Use cases for different applications

Page 12: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron – Generic chain

12

<!-- Data accumulation and trigger gadget --> <gadget> <name>AccTrig</name> <dll>gadgetron_mricore</dll> <classname>AcquisitionAccumulateTriggerGadget</classname> <property><name>trigger_dimension</name><value>Slice</value></property> <property><name>sorting_dimension</name><value></value></property> </gadget> <gadget> <name>BucketToBuffer</name> <dll>gadgetron_mricore</dll> <classname>BucketToBufferGadget</classname> <property><name>N_dimension</name><value>contrast</value></property> <property><name>S_dimension</name><value>average</value></property> <property><name>split_slices</name><value>false</value></property> <property><name>ignore_segment</name><value>true</value></property> <property><name>verbose</name><value>true</value></property> </gadget>

gadgetron/toolboxes/mri_core/mri_core_data.

h

gadgetron/toolboxes/mri_core/mri_core_acquisition_bucke

t.h

Page 13: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron – Generic chain

13

<!-- Recon --> <gadget> <name>Recon</name> <dll>gadgetron_mricore</dll> <classname>GenericReconCartesianGrappaGadget</classname> <!-- image series --> <property><name>image_series</name><value>0</value></property> <!-- Coil map estimation, Inati or Inati_Iter --> <property><name>coil_map_algorithm</name><value>Inati</value></property> <!-- Down stream coil compression --> <property><name>downstream_coil_compression</name><value>true</value></property> <property><name>downstream_coil_compression_thres</name><value>0.01</value></property> <property><name>downstream_coil_compression_num_modesKept</name><value>0</value></property> <!-- parameters for debug and timing --> <property><name>debug_folder</name><value></value></property> <property><name>perform_timing</name><value>true</value></property> <property><name>verbose</name><value>true</value></property> <!-- whether to send out gfactor --> <property><name>send_out_gfactor</name><value>false</value></property> </gadget>

7D kspace to 7D image

Page 14: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron – Generic chain

14

Other gadgets:

• SPiRIT and CS recon

• Coil compression

• Kspace filtering

• Partial fourier handling

• Image scaling and FOV

adjustment …

• Applications: cine, perfusion, t1

mapping, …

Page 15: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

15

ISMRMRD data format

Page 16: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

16

ISMRMRD data format is the backbone

0 5 10 15 20-500

0

500

CH

I (

RA

->LA

)

tpat3 RT Cine Bart Res160 Lighthouse FOV450 1200 (Start time: 15:49:38.8)

0 5 10 15 20-500

0

500

CH

II

(RA

->R

L)

0 5 10 15 20-500

0

500

CH

III

(LA

->R

L)

0 5 10 15 20-500

0

500

CH

IV

(LL->

RL)

MR Kspace data ECG/respiratory/gradient waveform

Image

XML meta data for

any information

(e.g. ROIs)

New

• https://github.com/ismrmrd/ismrmrd

• Support different data formats

Page 17: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

17

ISMRMRD data format: C++/Python/Matlab

• https://github.com/ismrmrd/ismrmrd

• Stored in hdf5 file

• Scanner to ismrmrd data convertors can be downloaded at :

• Siemens: https://github.com/ismrmrd/siemens_to_ismrmrd

• GE: https://github.com/ismrmrd/ge_to_ismrmrd

• Philips: https://github.com/ismrmrd/philips_to_ismrmrd

• Bruker: https://github.com/ismrmrd/bruker_to_ismrmrd

• Load and work on ismrmrd data in:

• Matlab:

dset = ismrmrd.Dataset(filename, 'dataset’);

• Python:

import ismrmrd

f = ismrmrd.Dataset('./testdata.h5', '/dataset', True)

• C++

Page 18: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Gadgetron separated into toolboxes which

can be used externally.

Includes iterative and non-iterative

reconstructions.

Data preprocessing (noise adjustment, coil

compression, etc) not readily available, but

building blocks are.

18

Embedding Gadgetron in STIR

Page 19: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Create STIR Gadget for PET-preprocessing

Send PET data as ISMRMRD waveforms

19

Embedding STIR in Gadgetron

Page 20: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

20

ISMRMRD Waveforms

Page 21: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

21

ISMRMRD Waveforms

Page 22: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Recent development

22

GADGETRON

Page 23: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

In cloud …

23

GADGETRON

Page 24: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

• Unlimited computing resource

• Global availability

• Options for different

hardware/price combination

• Someone will do

maintenance/upgrade for us

Gadgetron at Microsoft Azure Motivation – Provide computing resource for advanced imaging techniques

24

Some imaging applications require a lot more computing cores and RAM

Avoid to purchase and maintain local computing devices

Money, space, staff, cooling,

gradually outdated hardware, …

Encrypted

connection

vs.

Our local rack Cloud

* East US data center, 08/06/2017

Page 25: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

25

Gadgetron at Microsoft Azure

Traffic

monitor

Cloud

controller

Load

balancer

ssh

Data

streaming

Gadgetron

Gadgetron

Gadgetron

Gadgetron

Start/stop

computing

nodes

Pipe data to

nodes This is configurable,

such as:

• Number of computing nodes

• Computing node type

• Strategy to pipe data to

nodes

e.g. Cine: data from

every slice gets a node

~10x

speedup

on the

cloud

To cloud

Page 26: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

26

Gadgetron at Cloud: Security

MARS External Gadgetron HostTCP/IP

ICE

MARS

Conta inerized Gadgetr on

(chroot)

TCP/IP

ICE

MARS

Cloud Ga dgetron Host

SSH

ICE

Passive security

• Patient identification

information stays in

scanner

• Only send kspace data

and minimal protocol

information (FOV, recon

matrix size etc.)

Active security

• SSH outbound tunnel

initiated by scanner – No

inbound connection

• RSA 4096-bit , encrypted

communication

• On demand connection –

close after each scan

*NIST recommended 3072-bit key

Page 27: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Machine Learning ready

27

GADGETRON

Page 28: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

28

Data …

• Gadgetron network allows

efficient data collection

• Cloud gives us computing

power and inline training

ability

• Fast clinical deployment of

ML applications

• We know how data are

acquired

Page 29: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

• C++ to/from python conversion

• Booth python

• Dock integration

Python interpreter

29

Develop ML applications in Gadgetron

C++

Gadgets Python

Gadget

Python

Gadget

C++

Gadgets

• Key data structures converters from/to python

• Docker images include CuDNN, tensorflow and PyTorch

• Very easy to deploy AI models on the scanner

Page 30: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

30

Inline Cine analysis: Stop manual contouring

~200ms per image on cpu

~40ms per image on good

GPU

Contours are sent back to

scanner fully automated !

https://www.linkedin.com/pulse/gadgetron-brings-ai-mr-scanner-room-improve-cardiac-exam-hui-xue/

Page 31: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

31

Future development

• Non-cartesian generic chain CPU/GPU regridding, kspace/image domain parallel imaging, different

spatial/temporal regularization, CS reconstruction

• Python binding for Gadgetron toolboxes Pybind11

```

import Gadgetron as gt

a = gt.wavelet(img, levels=4, wav_name=‘db2’)

```

• Enrich ISMRMRD data format to store labelled data/images

ROIs, landmarks, xml based reports etc…

• Enhanced matlab-Gadgetron integration

• and many more new toolboxes, library functions …

Page 32: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable

Imaging Computing and Recon

Analysis

32

Summary: Gadgetron, a data driven process

0 5 10 15 20-500

0

500

CH

I (

RA

->LA

)

tpat3 RT Cine Bart Res160 Lighthouse FOV450 1200 (Start time: 15:49:38.8)

0 5 10 15 20-500

0

500

CH

II

(RA

->R

L)

0 5 10 15 20-500

0

500

CH

III

(LA

->R

L)

0 5 10 15 20-500

0

500

CH

IV

(LL->

RL)

Data archive

Application

field Better images

Automation

Quantification etc…

Expert input,

Phenotype data

Model and

intelligence …

Raw

measurement

AI

Page 33: Update on Gadgetron - CCP PET-MR · 2018-07-23 · Gadgetron framework Architecture, Data types, Functionalities and toolboxes Deployment and Integration test Generic chain Enable