avatarMohammed El Amine Mokhtari

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

7135

Abstract

class="link-block"> <a href="https://pycad.co/nifti2dicom/"> <div> <div> <h2>How to Convert a Nifti File into Dicom Series Using Python - PYCAD</h2> <div><h3>Nifti to Dicom During my internship for my master's degree in computer vision, I worked on a project that used U-Net to…</h3></div> <div><p>pycad.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*2uuTaxOtBN3ztJNx)"></div> </div> </div> </a> </div><p id="f861"><b><i>GitHub</i></b></p><div id="d1c9" class="link-block"> <a href="https://github.com/amine0110/nifti2dicom"> <div> <div> <h2>GitHub - amine0110/nifti2dicom</h2> <div><h3>This repository contains the complete code for converting nifti files to dicom series. I needed this conversion during…</h3></div> <div><p>github.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*vi2HfJv2pgJyWOeT)"></div> </div> </div> </a> </div><p id="6aa3"><b><i>YouTube</i></b></p> <figure id="bddc"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FxJ27jQVnh1M%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxJ27jQVnh1M&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FxJ27jQVnh1M%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854"> </div> </div> </figure></iframe></div></div></figure><h2 id="95c7">Convert dicom series into nifti file</h2><p id="7782">Since we are able to convert the nifti file into the dicom series, we can also perform the opposite process, allowing you to create a single 3D file (nifti) as opposed to numerous 2D (dicoms) files.</p><p id="e869"><b><i>Blog</i></b></p><div id="b6b9" class="link-block"> <a href="https://pycad.co/how-to-convert-a-dicom-series-into-one-nifti-file-python/"> <div> <div> <h2>How to Convert a Dicom Series into one Nifti File (Python) - PYCAD</h2> <div><h3>In this article, I will give you a quick way of how to convert a directory of Dicom files into one volume file (nifti).</h3></div> <div><p>pycad.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*GGwi99BL5Aip_PRt)"></div> </div> </div> </a> </div><p id="17ca"><b><i>YouTube</i></b></p> <figure id="3863"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrtUSole1PaQ%3Fstart%3D18%26feature%3Doembed%26start%3D18&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrtUSole1PaQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrtUSole1PaQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854"> </div> </div> </figure></iframe></div></div></figure><h2 id="95bd">Convert numpy array into nifti file</h2><p id="e1b0">I occasionally had to convert a 3D numpy array into a nifti file. For example, this 3D numpy array could be a mask that you need to save as a nifti file in order to overlay over the actual scans. Here’s how to go about it.</p><div id="4068" class="link-block"> <a href="https://pycad.co/how-to-convert-array-into-nifti-python/"> <div> <div> <h2>How to convert a normal array into nifti file using Python - PYCAD</h2> <div><h3>To convert a normal array into nifti file, you need to convert the array into numpy array then use the Nibabel library…</h3></div> <div><p>pycad.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*Gv7tLpttetIbbme1)"></div> </div> </div> </a> </div><h1 id="ddf2">All Conversion in One Code</h1><p id="57a4">I combined all the processes with the troubleshooting and optimization into one code that can be used as a graphical user interface after having all these scripts for the various conversions. This will make it easier for you to live a life where everything is at hand.</p><div id="8758" class="link-block"> <a href="https://pycad.co/pycad-convert/"> <div> <div> <h2>Pycad Convert - PYCAD</h2> <div><h3>This tool allows you to do multiple conversions, from images, dicom files and nifti files with only single click.</h3></div> <div><p>pycad.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*viXYLl0BsredHOWZ)"></div> </div> </div> </a> </div><h1 id="0f9f">Pycad Resources for Deep Learning for Medical Imaging</h1><p id="7ee0">I also have several resources for deep learning for medical imaging on my website and YouTube channel. I’ll put them all in this section.</p><h2 id="c1aa">Preprocessing 3D medical images</h2><p id="6f73">Preprocessing is usually a crucial step before training the models in any field where deep learning is being applied. However, this is slightly different with medical imaging, particularly 3D images. Because of this, there is an <a href="https://pycad.co/deep-learning-for-medical-imaging-using-monai/"><b><i>open source framework called MONAI</i></b></a> that may assist you in performing this and many other tasks.</p><p id="54cd"><b><i>Blog</i></b></p><div id="2131" class="link-block"> <a href="https://pycad.co/preprocessing-3d-volumes-for-tumor-segmentation-using-monai-and-pytorch/"> <div> <div> <h2>Preprocessing 3D Volumes for Tumor Segmentation Using Monai and PyTorch - PYCAD</h2> <div><h3>Here's the video version of this article, which may include some explanations that I forgot to include in the article…</h3></div> <div><p>pycad.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*xZ2r_R2kGysoyVVj)"></div> </div> </div> </a> </div><p id="6132"><

Options

b><i>GitHub</i></b></p><div id="26fd" class="link-block"> <a href="https://github.com/amine0110/preporcess-volume-medical-imaging"> <div> <div> <h2>GitHub - amine0110/preporcess-volume-medical-imaging</h2> <div><h3>Regarding the difficulties that we can encounter when using traditional image processing tools, deep learning has…</h3></div> <div><p>github.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*V_Kq_-5VC5PrsppX)"></div> </div> </div> </a> </div><p id="c4f0"><b><i>YouTube</i></b></p> <figure id="2117"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F83FLt4fPNGs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D83FLt4fPNGs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F83FLt4fPNGs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854"> </div> </div> </figure></iframe></div></div></figure><h2 id="6f5b">Augmenting 3D medical images</h2><p id="8b32">The data augmentation step is another one that is frequently necessary to train a deep learning model. We are aware that a lot of data is needed to train a neural network. Augmenting medical images differs from augmenting regular images. Here is an illustration of how to use always MONAI to augment 3D medical images.</p><p id="850a"><b><i>Blog</i></b></p><div id="ff5b" class="link-block"> <a href="https://pycad.co/3d-volumes-augmentation-for-tumor-segmentation/"> <div> <div> <h2>3D Volumes Augmentation for Tumor Segmentation using Monai - PYCAD</h2> <div><h3>Using Python and Monai to augment your dataset for tumor or organ segmentation. Find a sponsor for your web site. Get…</h3></div> <div><p>pycad.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*ZEV69PKOEZPUEl8A)"></div> </div> </div> </a> </div><p id="922d"><b><i>GitHub</i></b></p><div id="007e" class="link-block"> <a href="https://github.com/amine0110/data-augmentation-for-3D-volumes"> <div> <div> <h2>GitHub - amine0110/data-augmentation-for-3D-volumes</h2> <div><h3>We discussed how to preprocess 3D volumes for tumor segmentation in the previous article, so in this article we will…</h3></div> <div><p>github.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*IBf7eZbix9xJjCrN)"></div> </div> </div> </a> </div><p id="8549"><b><i>YouTube</i></b></p> <figure id="2459"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fbh9uyUbsj7U%3Fstart%3D564%26feature%3Doembed%26start%3D564&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dbh9uyUbsj7U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fbh9uyUbsj7U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854"> </div> </div> </figure></iframe></div></div></figure><h1 id="830a">Full Course About MONAI for Medical Imaging</h1><p id="ac7c">In order to teach a deep learning model for autonomous liver segmentation, I have created a free 5-hour course. You may find the course on my YouTube channel at this link:</p> <figure id="4768"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAU4KlXKKnac%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAU4KlXKKnac&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAU4KlXKKnac%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854"> </div> </div> </figure></iframe></div></div></figure><p id="10f9"><b><i>Blogs</i></b></p><ul><li><a href="https://pycad.co/liver-segmentation-part-1/">Automatic Liver Segmentation — Part 1/4: Introduction</a></li><li><a href="https://pycad.co/liver-segmentation-part-2/">Automatic Liver Segmentation — Part 2/4: Data Preparation and Preprocess</a></li><li><a href="https://pycad.co/liver-segmentation-part-3/">Automatic Liver Segmentation — Part 3/4: Common Errors</a></li><li><a href="https://pycad.co/liver-segmentation-part-4/">Automatic Liver Segmentation — Part 4/4: Train and Test the Model</a></li></ul><p id="51e3"><b><i>GitHub</i></b></p><div id="0395" class="link-block"> <a href="https://github.com/amine0110/Liver-Segmentation-Using-Monai-and-PyTorch"> <div> <div> <h2>GitHub - amine0110/Liver-Segmentation-Using-Monai-and-PyTorch</h2> <div><h3>You'll find all the Python files you need to accomplish liver segmentation with Monai and PyTorch in this repo, and you…</h3></div> <div><p>github.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*RsKsMRHt-AUUF8BG)"></div> </div> </div> </a> </div><h1 id="507e">Full Premium Course</h1><p id="8749">A new course on MONAI for medical image segmentation in 2D and 3D is shortly to be released. The entire process — from annotating the data to creating a trained model — will be covered, and a full lifetime of support is provided. You can sign up for our waiting list here if you’re interested:</p><div id="bad0" class="link-block"> <a href="https://pycad.co/deep-learning-for-medical-imaging/"> <div> <div> <h2>Deep Learning for Medical Imaging Landing Page - PYCAD</h2> <div><h3>2D and 3D Segmentation in Medical Imaging using Monai and PyTorch.</h3></div> <div><p>pycad.co</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*ziEenbi6vzrR68Jx)"></div> </div> </div> </a> </div></article></body>

Pycad for Medical Imaging (all you need to know)

Python Academy Resources for Medical Imaging

I compiled all the medical imaging resources from my blogs, GitHub repositories, and YouTube channel in this blog post. You can use this to get a sense of my current and previous work.

What is the difference between dicom and nifti files?

Every newcomer to medical imaging asks this topic frequently, therefore I made a blog post about it, which you can see here.

Medical imaging conversions

In this part, I’ll include the specific GitHub repositories and blog entries I’ve written to assist with converting between regular images and medical images.

Convert JPG/PNG images into dicoms

If you’re interested in learning how to create dicom files from regular grayscale or RGB (3-channel) images, you can check out these:

Blog

GitHub

Convert dicom images into JPG

If you have dicoms series that you may want to use them to train a deep learning model or you want to share only the inside image (frame array) then you can do the reverse operation which is converting the dicom series into JPG images. You can do that for a single file or several files. The sources are as follows:

Blog

GitHub

YouTube

Convert nifti file into dicom series

After reading the blog post comparing dicom and nifti files, you now realize that a nifti file is simply a collection of dicom series. Because of this, I wrote a blog post and code that demonstrate how to perform this conversion.

NOTE: you need to notice that the method explained in this blog post is not very sufficient but I created a proper way to do this conversion and you will find it in the Medical Conversions app that I will show in the next sections.

Blog

GitHub

YouTube

Convert dicom series into nifti file

Since we are able to convert the nifti file into the dicom series, we can also perform the opposite process, allowing you to create a single 3D file (nifti) as opposed to numerous 2D (dicoms) files.

Blog

YouTube

Convert numpy array into nifti file

I occasionally had to convert a 3D numpy array into a nifti file. For example, this 3D numpy array could be a mask that you need to save as a nifti file in order to overlay over the actual scans. Here’s how to go about it.

All Conversion in One Code

I combined all the processes with the troubleshooting and optimization into one code that can be used as a graphical user interface after having all these scripts for the various conversions. This will make it easier for you to live a life where everything is at hand.

Pycad Resources for Deep Learning for Medical Imaging

I also have several resources for deep learning for medical imaging on my website and YouTube channel. I’ll put them all in this section.

Preprocessing 3D medical images

Preprocessing is usually a crucial step before training the models in any field where deep learning is being applied. However, this is slightly different with medical imaging, particularly 3D images. Because of this, there is an open source framework called MONAI that may assist you in performing this and many other tasks.

Blog

GitHub

YouTube

Augmenting 3D medical images

The data augmentation step is another one that is frequently necessary to train a deep learning model. We are aware that a lot of data is needed to train a neural network. Augmenting medical images differs from augmenting regular images. Here is an illustration of how to use always MONAI to augment 3D medical images.

Blog

GitHub

YouTube

Full Course About MONAI for Medical Imaging

In order to teach a deep learning model for autonomous liver segmentation, I have created a free 5-hour course. You may find the course on my YouTube channel at this link:

Blogs

GitHub

Full Premium Course

A new course on MONAI for medical image segmentation in 2D and 3D is shortly to be released. The entire process — from annotating the data to creating a trained model — will be covered, and a full lifetime of support is provided. You can sign up for our waiting list here if you’re interested:

Medical Imaging
Healthcare
Deep Learning
AI
Python
Recommended from ReadMedium