[vtkusers] Overlaying simulation results on PNG image

Artem Babayan artem.paraview at googlemail.com
Tue Aug 30 12:02:08 EDT 2011

Hi, Sebastien

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).

Best wishes

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,
> Seb
> On Tue, Aug 30, 2011 at 10:21 AM, Artem Babayan
> <artem.paraview at googlemail.com> wrote:
>> Hi,
>> 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<vtkImageViewer>::New();
>>  image_viewer->SetInputConnection(png_reader->GetOutputPort());
>>  vtkSmartPointer<vtkDataSetMapper> mapper_png =
>>               vtkSmartPointer<vtkDataSetMapper>::New();
>>  mapper_png->SetInput(image_viewer->GetInput());
>>  actor_png->SetMapper(mapper_png);
>> //For conc field:
>>  vtkSmartPointer<vtkDataSetMapper> mapper_field =
>>               vtkSmartPointer<vtkDataSetMapper>::New();
>>  mapper_field->SetInput(data_set);
>>  actor_field->SetMapper(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
>> Artem
>> _______________________________________________
>> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.png
Type: image/png
Size: 11958 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110830/bb215ecc/attachment.png>

More information about the vtkusers mailing list