medicalformatconverter 1.2.0
A toolbox for converting medical imaging data between DICOM, NIfTI, and image formats.

## medicalformatconverter

_A toolbox for converting medical imaging data between `DICOM`, `NIfTI`, and standard `image` formats._

### Installation

To install, use `pip` to install this package:

    pip install medicalformatconverter

> **Note:** It is recommended to use `medicalformatconverter` on **Python 3.8**.


### Usage


> _**DICOM TO IMAGE FORMAT CONVERSION**_


#### Call `dicom2image` directly from Python script

```python
from toolbox.dicom2image import dicom_to_image
dicom_to_image(path/to/dicom/directory, path/to/image/directory, brightness)
```

- `path/to/dicom/directory` please provide the directory path for the DICOM files. (**type:** *str*)
- `path/to/image/directory` please provide the directory path for the image files. (**type:** *str*)
- `brightness` please provide the brightness to adjust the ndarray image files. (**type:** *float*)

#### Examples of Different Brightness Values


When `brightness` is set to **_0.2_**, the output will be displayed as follows:

![](brightness_0.2.png)

When `brightness` is set to **_1.2_**, the output will be displayed as follows:

![](brightness_1.2.png)


> **_DICOM TO NIFTI FORMAT CONVERSION_**

#### Call `dicom2nifti` directly from Python script

```Python
from toolbox.dicom2nifti import dicom_to_nifti

dicom_to_nifti(path/to/dicom/directory, nifti/file/name, path/to/nifti/directory)
```

- `path/to/dicom/directory` please provide the directory path for the DICOM files. (**type:** *str*)
- `path/to/nifti/directory` please provide the directory path for the nifti files. (**type:** *str*)
- `nifti/file/name` please provide the file name for the nifti file. (**type:** _str_)


> **_IMAGE TO NIFTI FORMAT CONVERSION_**
 
#### Call `image2nifti` directly from Python script


```Python
from image2nifti import image_to_nifti

image_to_nifti(path/to/image/directory, path/to/nifti/directory, nifti/file/name)
```

`path/to/dicom/directory` please provide the directory path for the DICOM files. (**type:** _str_)
`path/to/nifti/directory` please provide the directory path for the image files. (**type:** _str_)
`nifti/file/name` please provide the file name for the nifti file. (**type:** _str_)


> **_NIFTI TO DICOM CONVERSION_**
 
#### Call `nifti2dicom` directly from Python script


```Python
from nifti2dicom import nifti_to_dicom

nifti_to_dicom(path/to/nifti/file, path/to/output/directory)
```

- `path/to/output/directory` please provide the directory path for the NifTI files. (**type:** *str*)
- `path/to/output/directory` please provide the directory path for the DICOM files. (**type:** *str*)


> **_NIFTI TO IMAGE CONVERSION_**


#### Call `nifti2image` directly from Python script


```Python
from nifti2image import nifti_to_image

nifti_to_image(path/to/nifti/file, path/to/image/directory)
```

- `path/to/input/directory` please provide the directory path for the NifTI files. (**type:** *str*)
- `path/to/output/directory` please provide the directory path for the image files. (**type:** *str*) 







### License

```
All Rights Reserved

The contents of this repository are proprietary and confidential. Unauthorized copying, distribution, or other use of any files within this repository is strictly prohibited without prior written permission from the repository owner.

For licensing inquiries, please contact Wei-Chun Kevin Tsai at cnnlabproject@gmail.com.
```