[vtkusers] Sphere with scalar values

David Doria daviddoria+vtk at gmail.com
Sat Jan 16 11:52:47 EST 2010


On Sat, Jan 16, 2010 at 11:49 AM, KS Jothybasu <jothybasu at gmail.com> wrote:
> vtkPSphereSource means "sphere source that supports pieces " as the vtk doc
> says.
>
> I don't understand what supporting pieces means.
>
> Regarding my sphere object.
>
> I need to create a sphere object, let's say 5 cm radius. Indise that I want
> to set scalar values as we set for vtkImageData with
> SetScalarComponentFromFloat(x,y,z,0,HU).
>
> Thanks
>
> Jothy
>
>
>
> On Sat, Jan 16, 2010 at 4:37 PM, David Doria <daviddoria+vtk at gmail.com>
> wrote:
>>
>> On Sat, Jan 16, 2010 at 10:30 AM, KS Jothybasu <jothybasu at gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I am trying to create a sphere object comprising of voxels and setting
>> > the
>> > scalar values. But I am yet a find a proper method to do this.
>> >
>> > Could any of you please give me a hint?
>> >
>> > Should I create sphere object with polydata?
>> >
>> > What's the difference between vtkSphereSource and vtkPSphereSource
>> >
>> > Thanks
>> >
>> > Jothy
>> >
>>
>> If I understand correctly, vtkP* means it is a parallel version of the
>> vtk* filter. I don't think it has any relevance to your question.
>>
>> I guess I don't follow what you mean by "a sphere object comprising of
>> voxels". Can you elaborate or give an example?
>>
>> Thanks,
>>
>> David
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>
>

Please keep the discussion on the mailing list.

I agree that "supporting pieces" is not very clear. What I believe it
means is that the memory that comprises the object is split into
"pieces" which reside on multiple computers (hence, the parallel
version of the object).

Why don't you just create an ImageData and for each point in the
ImageData test if it is inside your sphere. If it is, then set it's
scalar value.

Will that work?

Thanks,

David



More information about the vtkusers mailing list