profile

Machine Learning for Medical Imaging

Do you know this about NIFTI files?

Published 4 months ago • 3 min read

Hello Reader,

Welcome to another edition of PYCAD newsletter where we cover interesting topics in Machine Learning and Computer Vision applied to Medical Imaging. The goal of this newsletter is to help you stay up-to-date and learn important concepts in this amazing field! I've got some cool insights for you below ↓

​

Working with NIFTI Files

If you’ve ever worked with NIFTI files in medical imaging, then you know how important the affine matrix is.

This is a matrix that contains information about the patient’s scan spatial dimensions, such as the reference origin and direction.

Any type of information or insight you want to overlay on your NIFTI image needs to take into consideration this affine matrix.

Many times you’ll find 2 different tags in the NIFTI file header: “affine” and “original_affine”.

Here’s the difference between them and why you should pay close attention to this detail next time you’re working with NIFTI files.

“affine” tag represents the adaptive affine matrix. This is a matrix that will keep changing whenever you’re applying new transformations on your NIFTI image.

“original_affine” on the other hand, is the affine matrix of the original image before any transformation has been applied.

Here’s an example where this detail is important.

Let’s say you trained a deep learning model that does segmentation on 3D medical data.

Your model is now ready and you’re using it to do inference on new data.

So you load a NIFTI image, you do some transformations on it to make it ready for your deep learning model, you run the inference and you get the output segmentation map.

Now, you want to overlay the segmentation map on top of your original image for some visualization app.

Now, during the saving of the segmentation map, if you had used the “affine” tag to get the affine matrix to apply it on the segmentation map, then you might find that the segmentation that you saved does not overlay correctly on your original image!

This is because you have applied transformations on your original image, which affected the affine matrix.

If you want to have your segmentation map correctly overlaid on your original NIFTI image, then you should use the “original_affine” tag when getting the affine matrix.

​

Where Can You Get Freely Available DICOM datasets?

​

Many people ask me where they can get medical data to play with and to use it to build AI models.

One of my top resources for getting DICOM data is the Cancer Imaging Archive website.

This website contain a ton of medical data. Though it’s focused on cancer imaging, you’ll find data of different organs and anatomical parts of the body.

You can access the website here: https://www.cancerimagingarchive.net/​

The website contains a lot of data, but it’s sometimes hard to find what you exactly need.

Let’s say you’re looking for a dataset for some specific bones in the body. One very useful way to find what you need is by filtering datasets through metadata tags found in DICOMs.

This can be done directly through the radiology portal on the website: https://nbia.cancerimagingarchive.net/nbia-search/​

​

We Released a New Medical Imaging Web App to Help You with Annotating Medical Data

​

Have you checked out yet the latest tool developed by the PYCAD team?

It’s a tool that allows you to automatically segment 6 different parts of the body:

  • Liver
  • Heart
  • Spleen
  • Lungs
  • Hips bones
  • Spine

The purpose of this tool is to help you quickly annotate 3D medical data if you’re looking to train your own model.

Instead of spending hours doing manual annotation from scratch, you can upload your zipped folder that contains DICOM files, then you choose one of the available models and you run it on your own data.

You will then be able to download NIFTI files of the segmentation maps.

You can then take these segmentation maps and upload them to your favorite annotation tool (3D Slicer, ITK Snap, …) and you then just do modifications where needed.

The app also allows you to visualize the STL object that was constructed from the segmentation maps. This is typically the type of files that you’d use to do 3D printing.

Check out the app here: https://www.annotation.pycad.co/​


We Can Help You with Your Next Medical Imaging Project

If your company or organization is looking to build a machine learning solution for a medical imaging problem, then feel free to reach out to us at:

​contact@pycad.co​

We can help you build a full ML solution from training to deployment with affordable rates!

You can check out some of the projects that we worked on here:

​https://pycad.co/portfolio and some of our clients case studies here.

​

That's it for this week's edition, I hope you enjoyed it!

​

Machine Learning for Medical Imaging

by Nour Islam Mokhtari from pycad.co

👉 Learn how to build AI systems for medical imaging domain by leveraging tools and techniques that I share with you! | 💡 The newsletter is read by people from: Nvidia, Baker Hughes, Harvard, NYU, Columbia University, University of Toronto and more!

Read more from Machine Learning for Medical Imaging

Hi Reader,, Welcome to the PYCAD newsletter, where every week you receive doses of machine learning and computer vision techniques and tools to help you learn how to build AI solutions to empower the most vulnerable members of our society, patients. TotalSegmentator : Whole Body Segmentation at your Fingertips This free tool available online can do full body segmentation, it's called TotalSegmentator. I have already mentioned this tool in a previous edition of the newsletter, but in this...

9 days ago • 3 min read

Hello Reader, Welcome to another edition of PYCAD newsletter where we cover interesting topics in Machine Learning and Computer Vision applied to Medical Imaging. The goal of this newsletter is to help you stay up-to-date and learn important concepts in this amazing field! I've got some cool insights for you below ↓ A Medical Imaging Expert Told Me This Recently I saw a post on LinkedIn where a medical imaging expert showcased his work of segmenting the lungs and its bronchial trees. You can...

16 days ago • 2 min read

Hello Reader, Welcome to another edition of PYCAD newsletter where we cover interesting topics in Machine Learning and Computer Vision applied to Medical Imaging. The goal of this newsletter is to help you stay up-to-date and learn important concepts in this amazing field! I've got some cool insights for you below ↓ How we helped accelerate inference time for a client's AI product Below is a screenshot of a benchmark we did for a client of ours. The goal was to accelerate inference time. This...

22 days ago • 3 min read
Share this post