saving multiple colors (Models) within one STL or VTK?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

saving multiple colors (Models) within one STL or VTK?

Christoph
Hello People,

I am built a 3D Model with multiple colors (eg.: Threshold)
Now I need to save the 3D model(s) with the different colors within one stl or vtk.

Is there a possibility to do that?

Could somebody help me please?

Thx,
Chris
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Andras Lasso
Colors in a surface mesh are stored as scalars assigned to points or cells.
STL file format cannot store cell data, so you definitely cannot export a
color model to STL file. VTK file format may be able to store scalar data,
but you would need a module in Slicer that assigns a scalar to each
point/cell of a model polydata and merges the models into one. I don't think
there is a module for this in Slicer, but if you are familiar with VTK and
ready to do some simple Slicer scripting then you can easily create such
module. If you don't want to do programming then you can use Paraview to
assign scalars to surface model points and combine the models into one.

Andras

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Christoph
Sent: May 9, 2012 8:49 AM
To: [hidden email]
Subject: [slicer-users] saving multiple colors (Models) within one STL or
VTK?

Hello People,

I am built a 3D Model with multiple colors (eg.: Threshold) Now I need to
save the 3D model(s) with the different colors within one stl or vtk.

Is there a possibility to do that?

Could somebody help me please?

Thx,
Chris

--
View this message in context:
http://slicer-users.65878.n3.nabble.com/saving-multiple-colors-Models-within
-one-STL-or-VTK-tp3974004.html
Sent from the slicer-users mailing list archive at Nabble.com.
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email]
with unsubscribe as the subject

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Aucoin, Nicole
The VTK surface model format will support scalar arrays when you save in
.vtk or .vtp format.
In the Models module, there's a drop down menu in the Display, Scalars
tab that allows you to chose which of the scalar arrays associated with
a model are displayed (I don't think that on loading the scalars are
turned on by default).
Unfortunately there's no UI element that allows you to build a scalar
array and then assign it (beyond loading it from a file via Add Data and
picking "Scalar Overlay" for the format and a model to assign it to) but
it sounds like Chris has one created one already.

Nicole

On 05/09/2012 09:13 AM, Andras Lasso wrote:

> Colors in a surface mesh are stored as scalars assigned to points or cells.
> STL file format cannot store cell data, so you definitely cannot export a
> color model to STL file. VTK file format may be able to store scalar data,
> but you would need a module in Slicer that assigns a scalar to each
> point/cell of a model polydata and merges the models into one. I don't think
> there is a module for this in Slicer, but if you are familiar with VTK and
> ready to do some simple Slicer scripting then you can easily create such
> module. If you don't want to do programming then you can use Paraview to
> assign scalars to surface model points and combine the models into one.
>
> Andras
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Christoph
> Sent: May 9, 2012 8:49 AM
> To: [hidden email]
> Subject: [slicer-users] saving multiple colors (Models) within one STL or
> VTK?
>
> Hello People,
>
> I am built a 3D Model with multiple colors (eg.: Threshold) Now I need to
> save the 3D model(s) with the different colors within one stl or vtk.
>
> Is there a possibility to do that?
>
> Could somebody help me please?
>
> Thx,
> Chris
>
> --
> View this message in context:
> http://slicer-users.65878.n3.nabble.com/saving-multiple-colors-Models-within
> -one-STL-or-VTK-tp3974004.html
> Sent from the slicer-users mailing list archive at Nabble.com.
> _______________________________________________
> slicer-users mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to [hidden email]
> with unsubscribe as the subject
>
> _______________________________________________
> slicer-users mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Christoph
In reply to this post by Andras Lasso
Hello Andras,

thx for your fast answer. I tried now to fuse the created models.
I created 4 models with slicer and saved them individual in vtk files.
Furthermore I tried to save them with ParaView within one file, but it did not work.
I assigned to every model one color with this selection: Color by Normals and an selection of color type.

It looks pretty, but after saving (vtk) there is still only one color.
What did I do wrong?

Could you please explain it to me?

For the second option which simple Slicer scripting form the tutorials list below do I have to do?
http://www.slicer.org/slicerWiki/index.php/4.0/Training

Thx for your help,
Chris
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Christoph
In reply to this post by Aucoin, Nicole
Hello Nicole,

thx for your answer. I only created several models (4 models) according to their grey-values.
Afterwards I displayed them in slicer.
Now I just would like to join all models within one file like vtk or vrml format.

Please let me know if you know a solution.

Thx,
Chris
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Aucoin, Nicole
Hi Chris,

You can use the Merge Models module to merge two, you'll have to do it
pairwise to build one model up from 4 models ( 1 & 2 -> 5, 5 + 3 -> 6, 6
+ 4 -> 7).

Nicole

On 05/09/2012 01:05 PM, Christoph wrote:

> Hello Nicole,
>
> thx for your answer. I only created several models (4 models) according to
> their grey-values.
> Afterwards I displayed them in slicer.
> Now I just would like to join all models within one file like vtk or vrml
> format.
>
> Please let me know if you know a solution.
>
> Thx,
> Chris
>
> --
> View this message in context: http://slicer-users.65878.n3.nabble.com/saving-multiple-colors-Models-within-one-STL-or-VTK-tp3974004p3974740.html
> Sent from the slicer-users mailing list archive at Nabble.com.
> _______________________________________________
> slicer-users mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Andras Lasso
In reply to this post by Christoph
Merge multiple STL files into a single colored VTK file in Paraview:
-Load all the models
-Assign a constant scalar to the points by using the Calculator filter (use
a different constant for each model, e.g., 1, 2, 3, 4, ...)
-Merge the Calculator outputs with the Append Geometry filter
-Save the Append Geometry filter output with File / Save Data / File type
VTK or VTP
(see the attached screenshot, or download the sample ParaView state file
from here http://dl.dropbox.com/u/1528749/SlicerHelp/merge.pvsm)

Then in Slicer you can load the model, open the Models module, open Scalars,
enable "Visible", select "Result" as active scalar, select a color table
(see attached Slicer screenshot)

Andras


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Christoph
Sent: Wednesday, May 09, 2012 12:52 PM
To: [hidden email]
Subject: Re: [slicer-users] saving multiple colors (Models) within one STL
or VTK?

Hello Andras,

thx for your fast answer. I tried now to fuse the created models.
I created 4 models with slicer and saved them individual in vtk files.
Furthermore I tried to save them with ParaView within one file, but it did
not work.
I assigned to every model one color with this selection: Color by Normals
and an selection of color type.

It looks pretty, but after saving (vtk) there is still only one color.
What did I do wrong?

Could you please explain it to me?

For the second option which simple Slicer scripting form the tutorials list
below do I have to do?
http://www.slicer.org/slicerWiki/index.php/4.0/Training

Thx for your help,
Chris

--
View this message in context:
http://slicer-users.65878.n3.nabble.com/saving-multiple-colors-Models-within
-one-STL-or-VTK-tp3974004p3974701.html
Sent from the slicer-users mailing list archive at Nabble.com.
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email]
with unsubscribe as the subject

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject

merge_models_paraview.png (141K) Download Attachment
merge_models_view_slicer.png (70K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Christoph
In reply to this post by Aucoin, Nicole
Hi Nicole,

thx I tried it, but I still get only one color at the merged models.

Is there a possibility to get more colors?

Thx,
Chris
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Christoph
In reply to this post by Andras Lasso
Hi Andras,

thx for the explanation.
I am just wondering how the calculator filter in paraview works?
Could you please explain it in more detail?

Thx,
Chris
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Aucoin, Nicole
In reply to this post by Christoph
In Slicer we assume one base colour per model, you'd have to make a
scalar overlay to get different colours on one model.

Nicole

On 05/09/2012 02:47 PM, Christoph wrote:

> Hi Nicole,
>
> thx I tried it, but I still get only one color at the merged models.
>
> Is there a possibility to get more colors?
>
> Thx,
> Chris
>
> --
> View this message in context: http://slicer-users.65878.n3.nabble.com/saving-multiple-colors-Models-within-one-STL-or-VTK-tp3974004p3975016.html
> Sent from the slicer-users mailing list archive at Nabble.com.
> _______________________________________________
> slicer-users mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Christoph
This post was updated on .
Hello Nicole,

thx for you answer.
So you mean the same like Andras? :
http://slicer-users.65878.n3.nabble.com/attachment/3974815/1/merge_models_view_slicer.png

I tried to save it as a vtk file, but even if I change the color tables the vtk file looks the same.
Could you please explain me, what I did wrong?
Do you probably know how I can assign certain colors to certain segmentation (eg.: Threshold,..) and save it as vtk file?
It would be of great help for me.

Thx,
Chris
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Aucoin, Nicole
Hi Chris,

If you use Paraview as Andras mentioned you can do what you want, but in
Slicer the colour tables are associated with the models through the MRML
scene file, rather than at the VTK geometry level. There's no user
interface in Slicer to do what you want to do, it requires some coding
to craft a scalar overlay to assign colours to regions of a model. Feel
free to submit a feature request on the Mantis bug tracker:
http://www.na-mic.org/Bug/bug_report_advanced_page.php

For assigning colours to a segmentation range, that can be done on the
label map volume level via the Editor module Threshold tool or the
Threshold Scalar Volume module, but not on models.

Nicole

On 05/10/2012 08:06 AM, Christoph wrote:

> Hello Nicole,
>
> so you mean the same like Andras? :
> http://slicer-users.65878.n3.nabble.com/attachment/3974815/1/merge_models_view_slicer.png
> I tried to save the dataset with different color tables, but the vtk file
> looks always similar, even when I changed the color tables.
> Could you please explain me what I did wrong?
> Do you probably know if it is possible to assign certain colors to a certain
> segmentation (threshold range)?
>
> It would be a great help for me.
>
> Thx,
> Chris
>
> --
> View this message in context: http://slicer-users.65878.n3.nabble.com/saving-multiple-colors-Models-within-one-STL-or-VTK-tp3974004p3976912.html
> Sent from the slicer-users mailing list archive at Nabble.com.
> _______________________________________________
> slicer-users mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Aucoin, Nicole
I made a mistake, I forgot about the "Probe Volume with Model" module.
It will create a scalar array on a model that's populated with values
from a volume. It works with label map volumes, so you can paint a model
from the label map from which it was created.

Nicole


On 05/10/2012 11:53 AM, Nicole Aucoin wrote:

> Hi Chris,
>
> If you use Paraview as Andras mentioned you can do what you want, but in
> Slicer the colour tables are associated with the models through the MRML
> scene file, rather than at the VTK geometry level. There's no user
> interface in Slicer to do what you want to do, it requires some coding
> to craft a scalar overlay to assign colours to regions of a model. Feel
> free to submit a feature request on the Mantis bug tracker:
> http://www.na-mic.org/Bug/bug_report_advanced_page.php
>
> For assigning colours to a segmentation range, that can be done on the
> label map volume level via the Editor module Threshold tool or the
> Threshold Scalar Volume module, but not on models.
>
> Nicole
>
> On 05/10/2012 08:06 AM, Christoph wrote:
>> Hello Nicole,
>>
>> so you mean the same like Andras? :
>> http://slicer-users.65878.n3.nabble.com/attachment/3974815/1/merge_models_view_slicer.png
>> I tried to save the dataset with different color tables, but the vtk file
>> looks always similar, even when I changed the color tables.
>> Could you please explain me what I did wrong?
>> Do you probably know if it is possible to assign certain colors to a certain
>> segmentation (threshold range)?
>>
>> It would be a great help for me.
>>
>> Thx,
>> Chris
>>
>> --
>> View this message in context: http://slicer-users.65878.n3.nabble.com/saving-multiple-colors-Models-within-one-STL-or-VTK-tp3974004p3976912.html
>> Sent from the slicer-users mailing list archive at Nabble.com.
>> _______________________________________________
>> slicer-users mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
> _______________________________________________
> slicer-users mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: saving multiple colors (Models) within one STL or VTK?

Christoph
Hello Nicole,

thx for your answer. Do you mean it´s possible to create 2 or more colors within one model with the "Probe Volume with Model"?
I tried it but it did not work.

Thx,
Chris