This document is to teach you how to convert image file types by using the Read Image Express VI and Write Image Express VI.
Biomedical Toolkit supports loading and converting files of the following file types:
- BMP(.bmp)
- JPG(.jpg)
- PNG(.png)
- DICOM(.dcm)
Use Read Image Express VI to load image data
You can use Read Image Express VI to load single image or image series. For more details about this VI, refer to the following document https://decibel.ni.com/content/docs/DOC-23800.
Use Write Image Express VI to write image data
Write Image Express VI is to write images to different file types, such as BMP, JPEG, PNG and DICOM.
VI Location
Configure Write Image
In the Write Action section, select Write multiple files when you want to write an image series.
- In the File Type section, select the image type you want to load.
- In the File Path Configuration section, do the following steps. Firstly, click Browse button next to the Folder path to select a folder path where the converted image files to be saved. You can also input the folder path through the terminal. Secondly, configure the name of image series in the Image Name Format subsection and Image Index subsection. For example, if the name of image series is CThead_000, CThead_001, … , CThead_112, then String prefix is CThead_, Number suffix width is 3, Start is 0 and End is 112. You can preview the file path through the File path preview.
- Input DICOM Attributes section is enabled only when you select DICOM (.dcm) item in the File Type. You can set the DICOM attributes including X pixel spacing, Y pixel spacing, Slice thickness, Window center and Window length.
- If A File Already exists, you can rename existing file or overwrite file.
Following is the block diagram of an example for converting PNG files to DICOM files. If you have installed Biomedical Toolkit LabVIEW 2012(32-bit) Support version, you can find this example Medical Image File Format Converter VI under the folder …\National Instruments\LabVIEW 2012\examples\Biomedical\Medical Image. And you can find the sample data used in this example under …\National Instruments\LabVIEW 2012\examples\Biomedical\Data\image\CThead.
Feel free to let us know your questions in using these VIs.