hey guys I'm Olivia I'm running through this software called 3D slicer in
which I will explain how we segment geometry based on images that we have so
usually in the medical world you will have a DICOM file in where they have
CT scan and MRI and you get all the DICOM file but in this case we will be
having just images that we use to with one of the system that we have so first
we load the data so we load the images that we have we choose file we pick
images that you will be given so just click one of the image and click open
because we are rendering the whole volume we will need two pictures and
take the single file so that will get the full volume of the image that we
have
so now we have image that is loaded and what we do if you right-click your mouse
button and just toggle around the image you will be able to change the
intensity of it and this button here or if you paint it you will be able to
select different things in this case I'm selecting the axis so that I can know
what's going on in my volume and if you want to change the view you can probably
use one of these button one of these options so I'm using the conventional in
which I have 3 different views and one view here with the volume so now I'm
just gonna change the intensity so that I can segment my geometry better, so next
we will have to set up our volume to be ready for segmentation so what we do is
we click volume and here we have different volume information so you set
it to 0.2 that's just because that's the image spacing that we use in
the system that we have so if you click this square button here for all three
views you will be able to identify three different views that we have so that's
the view that we have and you check if you move this button around you will be
able to see the entire stack of image that we have so that's the volume
so the next one that we will be changing is volume rendering so we are still in
the volume setting up the volume for segmentation so if you so here we'll be
able to see the different inputs that you want so we will just keep it by
default and next we will have crop volume so in crop volume you can display
the ROI so the ROI essentially is the Region Of Interest so you can fit the
volume and you can see that this is you know this is the volume that we have so
it means essentially these are the images that we have and if you just apply so
everything will be set by default and users apply so then you will have the
volume that you'll be working with so next we will be moving on to
segmentation so segmentation essentially is with all this image that we have we
will be segmenting to a 3d geometry so imagine this is all this image that we
have we will be moving towards a 3d geometry in this region of interest
right so let's go to segment editor and we will add one segment first so I'll
just rename this as Fame so essentially we will check the vein that
we have that it's in this image so that's different effects that you can
have so let's paint and there straw and that's level tracing and thus threshold
so these are the four different things that people usually use to segment a
geometry so if your grayscale is obvious you can use threshold but if you look at
this image the grayscale is not very obvious so you can't really segment it
based on different trash hole so I'll be using the manual method where we use
paint or level tracing so I'll just work on this image so I'll use the red slice
only so if you look at this image for level tracing it will trace the outline
of the lumen and for paint essentially what you do is you would draw the lumen
you can increase the size here depends on how big the lumen is or you wanna
zoom in the image by just zooming in with the scroll button so let's try one
of the slices I'll go back to conventional and I'll use paint and I'll
increase the size so that it's easier for me to visualize so what we do
first is that we follow through this image
so we follow true this lumen here and if you look at there we will follow through
all this lumen to capture the vein right so let's do that first
so I'll stop with the end of the picture some are here and I will increase the
size so that I can draw it and that's just follow through and this is the so
the start of the image so what you do is just following true the image to capture
the lumen
so now if you look at this image we are so that's quite mushy here you can
really see what's going on so but these 2 views will help you see what's going
on right so this is basically the connection for the other two arteries so
you will see the full image after we finish the segmentation but essentially
this is the connection where you will need to pay more attention in so essentially this
will be the one that you will need to capture
so when you do when you capture the image you don't have to well if you can
draw it perfectly they'll be great but if you can't you'll do smoothing at the
end where you will be able to get your to fix your image essentially so if you
look at this picture you can still get the tracing can use tracing tracing it
will be just tracing the lumen outline but but it will be tricky when the
tracing is not clear so you'll get like other parts here that you don't really
want so we will just stick with paint
paint will be but it's quite but it will do what we need to for for this
geometry for your assignment so this is the part where you capture the anastomosis
anastomosis essentially is the connection of the vein and the artery
so if you can see that's a pretty long thing here and that you will need to
capture everything
yeah just capture everything capture everything so if you make a mistake like
that then you can just undo or you an erase that's fine
so now we have done all the paint for most of the image and my follow-through
but if you look at that 3d, show 3d you will have all the different circles that
we see here so these different circles have to be filled with space so we fill
between it now we click fill between slices and we initialize essentially
what it does is it interpolates the different circle based on the one that
you have indicated showing if show 3d you have the full geometry and if you
apply it gives you a you know a 3d geometry that we have here so so that's
the vein and for this image that we have here we have another segmentation that
we need to do our name in the artery so for the artery essentially in this part
here it's actually harder to segment because you can't really see the artery so
this is the artery gets harder when it comes to places like if you move true so
that takes a bit more time compared to vein so let's just zoom in so that we
can see properly all right so I'll start with paint so it's easier for me if I
hide the button on this bit here so I can focus on the the artery so same thing
follow through the artery
it's trickier at the anastomosis so you have to have an overlap and if I unhide
the button you can see the overlap between the artery and the vein that's
just so that when you fill it together fill the spaces and do smoothing it will
be a full geometry that we see so same thing our follow through
and follow through the artery
so now we have two different parts if you show it so that's two different
parts that we work on separately to create the segmentation but we need to
combine the two of them into one just one segmentation so that we have just
one 3d STL file so what we do is we can do
click the logical operation and click Add and apply so now you can see that
that's just one one color and that's just telling us that you know we have
one geometry here we can on how we can hide this button so that we are just
working on one st one geometry one segmentation so now we work on one
geometry but look at that it's quite you know it's not smooth enough so what we
do is we do smoothing we click Gaussian and you can set this value to be
probably around five to seven so I'll put at six and you click apply so that's
no it's smoother and it looks pretty ok now we can work with this I think if you
zoom in zoom out you can probably look or can see the geometry better so just a
recap we did separate segmentation on the vein and the artery and now we have a
full STL file and we need to this is all in 3d slicer so we need to do a export to
have STL file so what we do is we click segmentation and we click model and
under export to file we pick where we want the file to be so in this case
I will just put it in this file and I'll choose and you take this two buttons and
you export it so you can see that this is the file
it's exported yeah so this is STL file I'm pretty happy about it right so once
we finish your 3d slicer you'll have a STL that looks like that and the next
step is to expand the boundary at this three different locations and the reason
why one extent that is so that the flow can be developed better when we run the
CFD simulation so we use this software called the VMTK you should have
them in your lab computer and you'll be paired up with the code and that looks
something like that so note that this bit here will need to
be the location of where your STL store and I'll just explain some of the
different things that are pretty important but you could just use the
default code so the VMTK flow extension you'll have it at 10 the ratio to be 10
that's just so that the ratio of the extension to be 10 and the export writer
so the surface right we VMTK surface writer is where your your file
will be writen so our name is model.STL so once you copy the code and you
can just you can choose to run the current line run selection or run all
I'll choose to run all now and the next one that you will see is this screen
here so you can use different smoothing methods before every VMTK to smooth the
geometry that's so well like mesh lab or different things but this is how this
one was just right off 3D slicer so if you don't think that it's smooth enough
you can use mesh lab so now it says that position the mouse to press space
to add source the source will be this bit here
we call it the distal artery and so I press a space and then you will see a
red button and I click Q so now it asked me to press and choose the target so the
target will be these two bits here and that's what we call the proximal vein
which is just this vein and proximal artery so same thing I quit
rendering cause I'm done with the whole rendering now it's computing the center
line
so if you look at the image it says not responding but if you click the task
manager it's actually working at the background and if you see python is
running don't be afraid just give it a few minutes before it computes the
center line so once you the center lines finish computing you will see that
there's different things that are shown here under the command so that's
basically executing the code that we provide so now it says please input
boundary IDs and if you look at the image here, there are 3 different IDs
that we have so we do is be input the IDS so it's zero space one space 2
click enter so if you see that it's not responding I'm don't be afraid but you
can do is you check your documents and see if anything is accomplished so if
here I looked at so that's this model done essentially what is that it's
basically done with all the expansion and you look at the image there's this
extension that is being placed from the geometry that we have so that's all from
3d slicer and VMTK hopefully that was helpful for you