Medical Image Annotation Tools for Machine Learning Models: Suitable for DICOM images.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome to my channel this is sahini from south bay california and i welcome you today so today's video is actually upon popular request from some of my subscribers who have been looking at the unit uh segmentation model that i had published a while ago that uses semantic segmentation so in that case you really need medical images along with annotations in order to build machine learning models to do semantic segmentation now the question is if you have medical images how do you come up with labels now typically you're stuck with public data sets just because getting good quality medical images that are annotated is really hard and especially so because of the data format sometimes are not recognized with standard software such as if it's a dicom file like a dot dcm then generally if it's a jpeg reader or a png or a tiff or a gif reader you will not be able to open the dicom images let alone annotate these images so in today's video what i will be showing you is two different softwares that i use in a sequence in succession in order to open a dicom image in order to even generate these a quick annotations uh you know from the medical specialist and export them as jpeg or pngs and then to read these you know jpeg and pngs using a software called that i've been using for a fairly long time for over a decade since i was a grad student and i've been using very easily in order to generate labels so using you can actually read a dicom images and then you can generate an image corresponding to the label so if there's pathology you will you can get like circular or bounding boxes corresponding to where the pathology lies so i will be showing you a tutorial and i will be you know giving you the links to how to download the software and also how to you know get the sample images that i'm looking at they're all public data sets in order to get yourself started with labels data so that then you can use the cool machine learning models such as unet so do stay tuned and if this kind of content that i'm providing for machine learning models for ai on medical images is of interest to you please give this video a thumbs up and subscribe to this channel [Music] so today we will be learning as to how to annotate medical images so for this in in order for our tutorial today to work i have three things that i have downloaded the first thing that i will be showing you is called micro dicom micro dicom is very powerful to to visualize dicom images that is the generally the format for for medical images and then the other software that we're going to be using is called it stands for gnu image manipulation program and uh what you will see is this gym again gamepis is free freely downloadable um in in some versions it is compatible with uh dicom images to read directly however uh i was facing issues you know reading dicom images directly into so what i what i will show you is how to use uh the micro dicom to first look at the images the dicom images to do some amount of annotations there and then to export it as a jpeg and this jpeg image will then be read by a in order to generate machine learning labels corresponding to them so let's get straight to it so what i have is this particular folder and again this is from a kegel data set is i have these folders full of dicom images and again these are dicom which you will not be able to view if you don't have the correct kind of viewer so this is a sample dcm file right now i have already set it to be opened with micro dicom and that is what i would um you know recommend as well and again this is the dicom browser you see better based off of wherever your uh you know cursor is it tells you where your x axis x location and y location is now the important part that i wanted to show you here was the calibration tools let's say you are interested in finding is how long is the uh is the you know spinal cord and it'll tell you that in this case it's a 138 millimeters or how wide was the chest cavity that you are analyzing so re-annotation the other things uh you know typically that that are helpful whenever you're coming up with the machine learning model is if you have an ellipse so let's say you are you see that there is pathology here and as soon as you point this ellipse it will show you you know the mean the median of of the pixels in this particular region of interest and the area and you know the maximum pixel and the minimum you know pixel values as well again if you don't need it you can just do control shift and delete all of that but that will get deleted or if you want to you know detect and see this is pathology then you know you keep your uh bounding boxes based off of that so you can have ellipses you can have of course bounding boxes whatever you think there is pathology again you can just annotate them this way and once you're done the next task is just to say export so and now what i'm going to be doing is i'm going to be exporting it to a file and i say export and it exported and now you can see that you know right next to the dicom image you can actually see that this was the annotated image now this kind of annotation is not very useful when you're coming up with machine learning models right because you generally need an image along with the file that tells you the exact bounding box locations or just to generate another image which is going to tell you okay this you know this area would be white and all other pixels will be black and then that would become your bitmap equivalent of the labels that you will be using for your machine learning models so in order to do that what i'll be doing is i will be opening this open with and i will be opening it with the software called which is gnu image manipulation program now ideally is capable of reading dicom images as well but somehow for for the version that i'm working with it is giving me issues and and i can show you if i go to the dicom image directly and if i say open with um it will say that could not load and again this is a versioning problem and you know maybe just incompatible with my windows current version but this is very common you see this is the message that comes up that it's it's unable to uh it is crashed on the dot dcm file so that's why for my current version what i really have to do is i'll have to first convert it from dicom to jpeg and then from the jpeg then i can you know create uh maps for it so this is uh you know let's say what the specialist has annotated for us and our intention is now to create a labeled uh you know image map from this so what i do here is first of all i go and i say create a new layer and in this case let's say that i'm calling this layer pathology all right and again if i just you know look at at the layers here you can actually see what these uh layers actually contain now for this pathology again that's the layer that that is selected it looks very similar to adobe where you can you know have layers and and color on them so what i would do is first of all the background needs to be filled out so the you know this is the the background that that was there so let me just remove the eye from there and then what i do is i go to tools and i say selection tool so first i'm interested in uh the rectangle regions of interest right so let me just do a rectangle and this is the region of interest and again if it doesn't fit correctly with what the specialist has annotated i will move it around till it does right and then once it is there i will say edit and fill fill with the you know white color and if you want to see if it was done correctly or not you can actually you know highlight this on on top of it but now you can actually see that this was the region that has already been annotated and now let me uh change this to uh an elliptical selection tool because the remaining regions are elliptical in nature then again you go edit and then you say you know fill with the with the white color and again to check if it did it you know what it's supposed to you can actually see you know one on top of the other and then again i have another one go in here and then say again edit fill with white color and now if you if you just you know make sure that you're looking at the whole thing you will see uh you know these become your annotated regions of interest so now what you would like to do is remove the eye you know from the actual image and now you go and say export as and then you can actually name so let me say mask one and then just hit export and what this will do is again it'll ask you the quality and everything and then it will if you go to exactly where your image was now you'll be able to see the exported mask so if your intention is to get uh you know annotated medical image data which is actually in the dicom file it is i would recommend it's a two-step process one in the first process you use the micro dicom viewer in order to you know generate these annotations from the doctor or from the specialists and the you know this this viewer is essentially just to convert the images from dicom to your jpeg and once you have done the the jpeg then you open it in and in you can always keep creating new layers and annotating images and then applying this for machine learning algorithm i hope you find this useful
Info
Channel: AI with Sohini
Views: 7,436
Rating: undefined out of 5
Keywords: #machinelearning, #ML, #artificial intelligence, #medical images, #annotation, #dicom, medical annotation, machine learning, computer vision, deep learning
Id: fx-qA9lvWPM
Channel Id: undefined
Length: 9min 43sec (583 seconds)
Published: Sat Mar 06 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.