MantisBT - VTK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0003579 | VTK | (No Category) | public | 2006-08-03 11:10 | 2016-08-12 09:54 |
Reporter | Mathieu Malaterre | ||||
Assigned To | Dave DeMarle | ||||
Priority | low | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Project | |||||
Type | |||||
Summary | 0003579: vtkLookupTable + vtkStructuredPointsWriter | ||||
Description | Hi all, In case someone already knows the answer I am posting this. Anyway here is a python script(*) that reproduce the bug. The faulty line is: writer.SetFileTypeToBinary() if a vtkImageData is saved with a vtkLookupTable in binary mode everything is ok, but when saved as ASCII then the LUT can't be reread properly. I'll try to find a patch ASAP. BTW, does anyone knows why I should explicitely set the TableRange ? lut.SetTableRange( 0, 255) Thanks, mathieu ################################################## (*) import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() reader = vtk.vtkBMPReader() reader.SetFileName( VTK_DATA_ROOT + '/Data/masonry.bmp' ) reader.Allow8BitBMPOn () reader.Update() #construct an image data with a lookup table image = reader.GetOutput() image.GetPointData().GetScalars().SetLookupTable( reader.GetLookupTable() ) writer = vtk.vtkStructuredPointsWriter() writer.SetInput( image ) writer.SetFileName( 'demolut.vtk' ) #writer.SetFileTypeToBinary() #culprit !!! writer.Write() reader2 = vtk.vtkStructuredPointsReader() reader2.SetFileName( 'demolut.vtk' ) reader2.UpdateWholeExtent() lut = reader2.GetOutput().GetPointData().GetScalars().GetLookupTable() lut.SetTableRange( 0, 255) #trick ?? map2 = vtk.vtkImageMapToColors () map2.SetInput (reader2.GetOutput()) map2.SetLookupTable ( lut ) map2.SetOutputFormatToRGB() iren = vtk.vtkRenderWindowInteractor(); viewer = vtk.vtkImageViewer2() viewer.SetInput (map2.GetOutput()) viewer.SetupInteractor (iren) #make interface iren.Initialize() iren.Start() ################################################## | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2008-11-30 09:09 | Mathieu Malaterre | Assigned To | Mathieu Malaterre => David Cole | ||
2011-01-19 09:54 | David Cole | Assigned To | David Cole => | ||
2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) | ||
2013-06-05 17:57 | Jean-Christophe Fillion-Robin | Note Added: 0030955 | |||
2013-06-06 02:51 | Mathieu Malaterre | Note Added: 0030964 | |||
2013-07-22 19:21 | Dave DeMarle | Note Added: 0031223 | |||
2013-07-22 19:21 | Dave DeMarle | Status | backlog => expired | ||
2013-07-22 19:21 | Dave DeMarle | Assigned To | => Dave DeMarle | ||
2016-08-12 09:54 | Kitware Robot | Note Added: 0036882 | |||
2016-08-12 09:54 | Kitware Robot | Status | expired => closed | ||
2016-08-12 09:54 | Kitware Robot | Resolution | open => moved |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|