Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Import MRI, CT and microCT data

hello,

I want to simulate 3D blood flow in the carotid artery.I made the geometry that I got from the CT angiography by using CATIA,but it can not be made precisely.I read in the "cad import and features" pdf that we can Import MRI, CT and microCT data via Mimics to Comsol.but I dont know how...
whould you please help me..

Thanks,Maral

9 Replies Last Post 2017年3月8日 GMT-0500上午8:39
COMSOL Moderator

Hello Maral Hassani

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Posted: 7 years ago 2010年11月8日 GMT-0500下午5:39
Hi Maral,

I don't know if you're still working on this project, but if you are and haven't made progress here, then maybe this information will help.

What you want to do is to use the loft command, but it's not simple or easy. Refer to the 3.5a Matlab Interface document and go to page102 for the "Images, Interpolation, and MRI Data"

On page 105, COMSOL gives an example using the built in MRI data that comes with MATLAB. If you try this, I recommend in step 5 (page 106), that you show your value of k, so you know which kf value needs to be changed. Note, this is indicated by giving you a warning, but the code will continue to run.

And I wish I could give you some advice on steps 7-9, setting up the appropriate el values with the right matrix sizes that are created by the repmat commands... well, that's how I stumbled onto your question. Let me know if this is old news to you and you've already done this and you could provide some hints!

Note, as of right now, COMSOL 4.0 and 4.0a do not support the loft commands, so this needs to be done in COMSOL 3.5a. Luckily, a document COMSOL posted months ago, said they plan on supporting the loft command when 4.1 comes out... which should be any day now.

PS, I ran this example on a server license of MATLAB (there was only 1 license). I couldn't get it to work without erroring out at the same line in the example every single time - the error was that there was only one license and it was in use. That required me going to COMSOL's support team.

Anyway, I hope some of this can help you.

Thanks,
Ben
Hi Maral, I don't know if you're still working on this project, but if you are and haven't made progress here, then maybe this information will help. What you want to do is to use the loft command, but it's not simple or easy. Refer to the 3.5a Matlab Interface document and go to page102 for the "Images, Interpolation, and MRI Data" On page 105, COMSOL gives an example using the built in MRI data that comes with MATLAB. If you try this, I recommend in step 5 (page 106), that you show your value of k, so you know which kf value needs to be changed. Note, this is indicated by giving you a warning, but the code will continue to run. And I wish I could give you some advice on steps 7-9, setting up the appropriate el values with the right matrix sizes that are created by the repmat commands... well, that's how I stumbled onto your question. Let me know if this is old news to you and you've already done this and you could provide some hints! Note, as of right now, COMSOL 4.0 and 4.0a do not support the loft commands, so this needs to be done in COMSOL 3.5a. Luckily, a document COMSOL posted months ago, said they plan on supporting the loft command when 4.1 comes out... which should be any day now. PS, I ran this example on a server license of MATLAB (there was only 1 license). I couldn't get it to work without erroring out at the same line in the example every single time - the error was that there was only one license and it was in use. That required me going to COMSOL's support team. Anyway, I hope some of this can help you. Thanks, Ben

Shivangi Kelkar
Posted: 7 years ago 2010年12月10日 GMT-0500下午3:53
Hi Ben
I am trying to reconstruct a 3D model from 2D MRI slices. I need to import the the 3D model to comsol and I am having trouble with the loft command too. I get the following error 'Lofting between objects with different number of edges not supported'. Let me know if you were successful in using that function!

Thanks,
Shivangi
Hi Ben I am trying to reconstruct a 3D model from 2D MRI slices. I need to import the the 3D model to comsol and I am having trouble with the loft command too. I get the following error 'Lofting between objects with different number of edges not supported'. Let me know if you were successful in using that function! Thanks, Shivangi

Posted: 7 years ago 2010年12月13日 GMT-0500上午10:25
Hi Shivangi,

I think I can help (maybe). It sounds like you need to tune your keepfrac values (this is the kf matrix).

First, If you open the COMSOL 3.5a Reference Guide and go to the pdf page 295 (listed as page 281 in the manual), you'll see the explanation of the LOFT command. On the third page of instructions for the loft command, there are several short examples which try to address how to loft between edges.

However, I didn't feel that I had a clear understanding when I received the same error you did. So I contacted COMSOL tech support and this is their response:

---------------------------------------------------------------------------------------------------------
A crucial part of the MRI import is to tune the value of keepfrac (kf) so that every created curve object consists of the same number of segments. After running flim2curve, simply type

c{:}

to view the number of boundary segments that each curve consists of. If there are curves with different number of segments, change the kf vector until all curves consist of the name number of segments (increase keepfrac
to to increase the number of segments and vice versa). It should be possible to make a while loop that varies kf for each segment until the desired number of segments is produced.


It may not be necessary to provide an 'el' struct, this is only necessary if you like to "rotate" during a loft from one section to another. To view the actual numbering of edges, use the command

geomplot(c{i},'edgelabels','on')


For a simple case, the dvr cell array can be constructed as follows:

dz = 10; % Distance for each loft
n_image = 25; % Number of slices
dvr = {repmat(dz,1,n_image-1),repmat(0,2,n_image),repmat(0,1,n_image)};

This command uses "no tilt" and "no rotation" (V and R matrices, respectively).
---------------------------------------------------------------------------------------------------------

(This information is from Anders Ekerot)



I hope this helps! I hope COMSOL also sees the thread and add more to the LOFT explanation or process for future version of COMSOL and their documentation. And if the folks at COMSOL already have, thank you! Please direct us to the new documentation!


Also, there's a company called Materialize which has a software called MIMICS which will upload MRI/CT images (and many other types too) and will very quickly generate a model of interest. Then in the Materialize software, there's 3-matics, which will produce a smoothed/reduced surface/volume mesh and export the resulting geometry/mesh for COMSOL.


Thanks,
Ben
Hi Shivangi, I think I can help (maybe). It sounds like you need to tune your keepfrac values (this is the kf matrix). First, If you open the COMSOL 3.5a Reference Guide and go to the pdf page 295 (listed as page 281 in the manual), you'll see the explanation of the LOFT command. On the third page of instructions for the loft command, there are several short examples which try to address how to loft between edges. However, I didn't feel that I had a clear understanding when I received the same error you did. So I contacted COMSOL tech support and this is their response: --------------------------------------------------------------------------------------------------------- A crucial part of the MRI import is to tune the value of keepfrac (kf) so that every created curve object consists of the same number of segments. After running flim2curve, simply type c{:} to view the number of boundary segments that each curve consists of. If there are curves with different number of segments, change the kf vector until all curves consist of the name number of segments (increase keepfrac to to increase the number of segments and vice versa). It should be possible to make a while loop that varies kf for each segment until the desired number of segments is produced. It may not be necessary to provide an 'el' struct, this is only necessary if you like to "rotate" during a loft from one section to another. To view the actual numbering of edges, use the command geomplot(c{i},'edgelabels','on') For a simple case, the dvr cell array can be constructed as follows: dz = 10; % Distance for each loft n_image = 25; % Number of slices dvr = {repmat(dz,1,n_image-1),repmat(0,2,n_image),repmat(0,1,n_image)}; This command uses "no tilt" and "no rotation" (V and R matrices, respectively). --------------------------------------------------------------------------------------------------------- (This information is from Anders Ekerot) I hope this helps! I hope COMSOL also sees the thread and add more to the LOFT explanation or process for future version of COMSOL and their documentation. And if the folks at COMSOL already have, thank you! Please direct us to the new documentation! Also, there's a company called Materialize which has a software called MIMICS which will upload MRI/CT images (and many other types too) and will very quickly generate a model of interest. Then in the Materialize software, there's 3-matics, which will produce a smoothed/reduced surface/volume mesh and export the resulting geometry/mesh for COMSOL. Thanks, Ben

Ariono Verdianto
Posted: 5 years ago 2012年10月8日 GMT-0400上午3:06
HI ben

that very interesting, could you tell about the sextion el, what the exact values must add to this section, and also
lofting section, could you give briefly explanation on it?

thanks
HI ben that very interesting, could you tell about the sextion el, what the exact values must add to this section, and also lofting section, could you give briefly explanation on it? thanks

Alexander Warning
Posted: 5 years ago 2012年10月8日 GMT-0400上午7:04
Here is one solution, compile your images in 3D doctor, produce a .stl file, and just import. this works great for me and 3D doctor is not that expensive. I can provide a few more details if anyone has questions
Here is one solution, compile your images in 3D doctor, produce a .stl file, and just import. this works great for me and 3D doctor is not that expensive. I can provide a few more details if anyone has questions

Ariono Verdianto
Posted: 5 years ago 2012年10月9日 GMT-0400上午5:25
HI Mr Alexander Warning,

thank you for your response, I have spent much money to buy some softwares, I just to find it solution without spend it again. could you help me?and also I have try a trial version 3D doctor, but it doesn't make a sense.
HI Mr Alexander Warning, thank you for your response, I have spent much money to buy some softwares, I just to find it solution without spend it again. could you help me?and also I have try a trial version 3D doctor, but it doesn't make a sense.

Posted: 4 years ago 2013年10月24日 GMT-0400上午10:43
Hi:

I've posted, in the Model Exchange, a method and example of using MATLAB and some free MATLAB libraries to take points on serial sections, loft into NURBS, and then import them into COMSOL. This process may be useful for your situation.

--Rich
Hi: I've posted, in the Model Exchange, a method and example of using MATLAB and some free MATLAB libraries to take points on serial sections, loft into NURBS, and then import them into COMSOL. This process may be useful for your situation. --Rich

Jeff Hiller COMSOL Employee
Posted: 2 years ago 2015年12月4日 GMT-0500上午10:39
Update to this thread: Nowadays, the Design Module (which did not exist when this thread was started) allows you to do lofting in the graphical user interface. See www.comsol.com/design-module .
Best,
Jeff
Update to this thread: Nowadays, the Design Module (which did not exist when this thread was started) allows you to do lofting in the graphical user interface. See http://www.comsol.com/design-module . Best, Jeff

Afshin Cheraghchi
Posted: 7 months ago 2017年3月8日 GMT-0500上午8:39
Hi sir
I was wondering, if you could guide me how can i import a ct scan of a body organism to comsol , or how to create for e.g an artery or vein in comsol
tnx alot
Hi sir I was wondering, if you could guide me how can i import a ct scan of a body organism to comsol , or how to create for e.g an artery or vein in comsol tnx alot

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.