[vtkusers] Resize an arbitrarily sized image

Bill Lorensen bill.lorensen at gmail.com
Thu Feb 5 09:17:15 EST 2015


You can use vtkImageChangeInformation to change the pixel size(spacing
in VTK terminology). Use the SetOutputSpacing. This filter does not
resample.

On Thu, Feb 5, 2015 at 7:09 AM, Cameron Lowell Palmer
<cameron.palmer at ntnu.no> wrote:
> From my standpoint an image is a bitmap, a field of dimensionless colored
> dots. When it comes to output it should be a matter of saying here is your
> space draw yourself here. So in my app, most objects are defined in mm
> because it just makes sense to do so for organs, but I have also imported a
> 2000x2000 px PNG. This is purely an experiment in dealing with image
> manipulation so the image is deliberately large. So I want this logo to be
> 7x7 cm in real terms.
>
> Now I have some options, but the question is what is the VTK way?
>
> * I can resample the image down to 70x70 and assign spacing of (1, 1, 1).
> * I can scale the image plane it is applied to.
> * Third option goes here.
>
> I’ve tried vtkImageResample and when you set an axis magnification of 0.5f
> you get a doubling of spacing and a halving of extent, but the bounds
> mostly(!) remains the same. Still, this isn’t really what I want, I want to
> just say, “Mr. Image you are 70mm.” BTW Talking to the image data didn’t
> work either.
>
>
> On 5. feb. 2015, at 14.37, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
> What do you mean by size of the image?
>
> On Feb 5, 2015 3:21 AM, "Cameron Lowell Palmer" <cameron.palmer at ntnu.no>
> wrote:
>>
>> I’m looking for a recommendation on how to scale imageData to a specific
>> size.
>>
>> I’ve used vtkImageResample, but what I really want to do is load a large
>> image, and then reset the size at some point. Ideally I would be able to
>> non-destructively change the size of the object.
>>
>> Thanks,
>>
>> cameron.
>>
>>
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtkusers mailing list