[vtk-developers] Wiki Examples - commited a fix

Dean Inglis dean.inglis at camris.ca
Mon Dec 21 15:43:35 EST 2009


Hi David,

yes, SetNumberOfDivisions must be called with something reasonable.
Actually, this to me seems like a bug.  Looking at vtkImageCheckerboard,
there does not appear to be a sanity check that the image dimensions
are in line with the requested number of divisions.  You can leave the 
Update
calls in if you like, but I think my fix illustrates a nice feature of VTK's 
pipeline
architecture:
just update (or render) downstream and the whole pipeline is updated back to 
the
source.  I wasn't sure where to post this thread, but in future will post 
anything
about VTK/Examples to users if that is what is needed.

BTW, Im working on commiting and example that illustrates continuous
cursoring over and image actor (it was requested on the wiki) and spits out
the pixel values to a vtkCornerAnnotation (a custom callback is part of the 
solution).

Dean

----- Original Message ----- 
From: "David Doria" <daviddoria+vtk at gmail.com>
Cc: "VTK Developers" <vtk-developers at vtk.org>
Sent: Monday, December 21, 2009 2:57 PM
Subject: Re: [vtk-developers] Wiki Examples - commited a fix


On Mon, Dec 21, 2009 at 12:31 PM, Dean Inglis <dean.inglis at camris.ca> wrote:
> Hi All,
>
> Im new to wiki, but I did figure how to upload a fix to the list
> of broken examples (visually compare two images with vtkimagecheckerboard)
> and then place the link from broken examples to Working with images.
> The only thing I couldnt figure out was how to remove the line
> above the code for Checkerboard.cxx that says the example is broken..
> a little help? BTW, I think the recent examples initiative is excellent!
>
> thanks,
> Dean

Dean,

First of all, thanks for contributing! This type of effort is what
will make this examples section really thrive! In the future, the
users list (rather than the developers list) is probably a better
place for this conversation.

So it looks like what I was missing was the SetNumberOfDivisions call?
It seems like there should be some default that would have happened
without that call rather than segfaulting?

Also, I believe we need to leave the Update() calls after the readers:
jPEGReader1->SetFileName ( inputFilename1.c_str() );
jPEGReader1->Update();

to ensure the data is actually read before it is used.

To edit the description text (where it says "this is currently
broken...") - use the "Edit" tab at the top of the page. I went ahead
and did it for this one:
http://www.cmake.org/Wiki/VTK/Examples/Visually_Compare_Two_Images

Thanks again - and keep up the good work!

David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers




More information about the vtk-developers mailing list