[vtkusers] Quick vtkImageViewer2 Reset Level question

Shakes Shekhar.Chandra at sci.monash.edu.au
Mon Apr 20 04:16:07 EDT 2009


Thanks Bryn!

I love the additions to imageviewer2 class. I need most of those 
features. Will see if I can add it to my DGV program
<http://qcplusplus.sourceforge.net/> and replace imageviewer2.

Cheers
Shakes

Bryn Lloyd wrote:
> try this:
> 
>   vtkImageData *image = viewer->GetInput();
>   this->range = image->GetScalarRange();
>   this->SetColorLevel(0.5 * (range[0] + range[1]));
>   this->SetColorWindow(range[1] - range[0]);
> 
> 
> 
> 
> 
> If you want to have additional features, e.g.
>  1. moving between slices of a 3D image (up/down keys)
>  2. picking points in the image (e.g. seed points for segmentation)
> 
> then check out my little extension to vtkImageViewer2:
> 
> http://www.vision.ee.ethz.ch/~blloyd/ImageViewer
> 
> Some explanation about it's usage is in the header file: ImageViewer.h
> 
> 
> You can also have a look at this thread:
> http://www.vtk.org/pipermail/vtkusers/2009-March/100043.html
> 
> 
> 
> --Bryn
> 
> 
> 
> 
> 
> 
> Shakes wrote:
>> Hi Guys,
>>
>> I just wanted to reset the window/level in vtkImageViewer2 through the 
>> API (rather than relying on user to press 'r'). Whats the easy way of 
>> doing this?
>>
>> Looked everywhere. vtkImageViewer2 is within a QVTKWidget btw. Thanks 
>> in advance.
>>
>> Cheers
>> Shakes
>>
>> VTK 5.2.1, Qt 4.4.3
>>
>> _______________________________________________
>> 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: Shekhar_Chandra.vcf
Type: text/x-vcard
Size: 247 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090420/2a82ab9c/attachment.vcf>


More information about the vtkusers mailing list