---
# System prepended metadata

title: Get started with ACDC

---

# Get started with ACDC

## ACDC : from raw data to 128x128 tensor

Each patient has a 4d (sucession of 3d volumes) image file.
This file is at NII format.

![image](https://hackmd.io/_uploads/H1M5CQyHkg.png)
![image](https://hackmd.io/_uploads/B1jo0m1BJx.png)


Monai or torchio offer method to open such files.

Moreover, two instant are saved for each patient : End-systole, End-diastole.

1 patient =(4d file, 3D ES file, 3D ED file, info.cfg)
For each diastol and sistol 3D volumes, we have segmentation mask for 4 classes (background, Myocradium, Left Ventricule, Right Ventricule).
info.cfg gives metadata. 

![image](https://hackmd.io/_uploads/ry_aXaAEyx.png)

For the first patient, at a precise instant, for a precise slice :
![image](https://hackmd.io/_uploads/r1wQATC4ye.png)

In order to load efficently a precise patient, we use ``get_scan_and_mask``.
Then for each slide, we identify bouding-boxes (by underlying non-zero area in each slice).
Finaly we resize each mask and 3d-volume to a unique size (H=128, W=128)

The function get_dataset load and preprocess each patient.
Then we save in a dataset module each ES/ED slice as an element of the dataset (annotated with the corresponding mask, a metadata about condition of the patient and an other for ES or ED)

![image](https://hackmd.io/_uploads/Bkly-A0Vkx.png)

## Use ACDCDataModule
![image](https://hackmd.io/_uploads/B14GZR0Nke.png)
![image](https://hackmd.io/_uploads/Sk5FWARE1l.png)
