[vtkusers] Overlaying simulation results on PNG image
artem.paraview at googlemail.com
Tue Aug 30 12:02:08 EDT 2011
Thank you for reply. The problem is illustrated by attached picture --
it shows 'background' png file and visualized concentration field
together. The generated image size is 800x800. The original size of
the 'background' PNG image is ~ 600x900 pixels, but it occupies only a
very small portion of the final picture (the black square). So I would
like to know why is it 'scaled down' and how to make it cover the
whole simulation area (in this case 30x30 cells 500m each).
On 30 August 2011 15:28, Sebastien Jourdain
<sebastien.jourdain at kitware.com> wrote:
> Hi Artem,
> you can use the actor transformation of the PNG image to stretch to
> the current value.
> As I don't fully understand your problem, I might provide an invalid
> answer. But based on the bounds of both your data, you should be able
> to determine the scale that you want to apply to the PNG so it could
> match the other.
> Good luck,
> On Tue, Aug 30, 2011 at 10:21 AM, Artem Babayan
> <artem.paraview at googlemail.com> wrote:
>> I have a 2D concentration field defined over 1000x1000m area on 50x50
>> rectangular grid. I have PNG image of the map of the area (e.g.
>> 400x400 pixels). I need to draw the concentration field over the map
>> (and to be able to rotate the resulting 2D image in 3D). How can I
>> make both pictures to cover the same area?
>> Providing, that I have
>> vtkSmartPointer<vtkDataSet> data_set
>> vtkSmartPointer<vtkPNGReader> png_reader
>> already filled with data and omitting parts for setting the lookup
>> table I do the following:
>> //For PNG image:
>> vtkSmartPointer<vtkImageViewer> image_viewer =
>> vtkSmartPointer<vtkDataSetMapper> mapper_png =
>> //For conc field:
>> vtkSmartPointer<vtkDataSetMapper> mapper_field =
>> and then add both actors to window for rendering. The PNG image covers
>> just as fraction of the area covered with concentration filed. Is it
>> possible to make PNG file automatically stretched over the
>> concentration field area Or, if it should be done manually, how to
>> calculate the required stretching coefficient?
>> Best wishes
>> 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:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11958 bytes
Desc: not available
More information about the vtkusers