<div dir="ltr"><div><div><div><div>Gerald,<br><br>I think there is the problem with this:<br><span style="font-family:monospace,monospace">if (!this->HasNewData())<br></span></div><span style="font-family:monospace,monospace"> return 1;</span><br><br></div>It means that most of the time, the filter will return an empty output.<br></div>Instead, you should cache (retain a pointer off oLatest as member variable) the last image and ShallowCopy it to the output in this case.<br><br></div><div>Something like:<br><br><span style="font-family:monospace,monospace"> if (this->HasNewData())<br> {<br> this->OLatest = this->m_poInternal->GetLatestImageData();<br> }<br><br> if (this->OLatest)<br> poOutput->ShallowCopy(this->OLatest);</span><br></div><div><br></div>Best,<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b>Joachim Pouderoux</b><font size="2">, <font size="1">PhD</font></font><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1"><i>Technical Expert - Scientific Computing Team</i></font><br><b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br></blockquote>
</div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2017-01-16 4:12 GMT-04:00 Lodron, Gerald <span dir="ltr"><<a href="mailto:Gerald.Lodron@joanneum.at" target="_blank">Gerald.Lodron@joanneum.at</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I uploaded a cleaned version of the reader without gui component to <a href="https://expirebox.com/download/b5db956fb2b0787ac16ef9b42e46698a.html" rel="noreferrer" target="_blank">https://expirebox.com/<wbr>download/<wbr>b5db956fb2b0787ac16ef9b42e4669<wbr>8a.html</a> (again 48h available). The GUI has included a timer which polls on the HasNewData() function and if it returns true it forces an update of the request data function. I copied that workflow of the PCLPlugin of Paraview of the Kinect OpenNI Source….. the commented code also displays the *.vti writing....<br>
<br>
Best regards,<br>
Gerald<br>
<span class="">Von: Joachim Pouderoux [mailto:<a href="mailto:joachim.pouderoux@kitware.com">joachim.pouderoux@<wbr>kitware.com</a>]<br>
</span>Gesendet: Freitag, 13. Jänner 2017 15:45<br>
<div class="HOEnZb"><div class="h5">An: Lodron, Gerald<br>
Cc: Paraview Developer (<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.<wbr>org</a>); Paraview User (<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>)<br>
Betreff: Re: [Paraview-developers] [Paraview] vtkImageData Plugin, vtkImageData not rendered<br>
<br>
Could you share the code of your reader? If you prefer you can remove all specific stuff and keep only VTK related stuff.<br>
I would like to see how exactly you fetch the output grid to fill and how your filter defines its output.<br>
Best,<br>
<br>
<br>
Joachim Pouderoux, PhD<br>
Technical Expert - Scientific Computing Team<br>
Kitware SAS<br>
<br>
2017-01-13 3:17 GMT-04:00 Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>:<br>
Nope, the data is then nearly empty (<1kByte), hiere the vti writer output:<br>
<br>
<VTKFile type="ImageData" version="1.0" byte_order="LittleEndian" header_type="UInt64"><br>
<ImageData WholeExtent="0 -1 0 -1 0 -1" Origin="0 0 0" Spacing="1 1 1"><br>
<Piece Extent="0 -1 0 -1 0 -1" ><br>
<PointData Scalars="21745593"><br>
<DataArray type="UInt8" Name="21745593" format="appended" RangeMin="1e+299" RangeMax="-1e+299" offset="0" /><br>
</PointData><br>
<CellData><br>
</CellData><br>
</Piece><br>
</ImageData><br>
<AppendedData encoding="raw"><br>
_<br>
</AppendedData><br>
</VTKFile><br>
<br>
Here the mhd header which I usually prefer, the “DimSize” is 0,0,0:<br>
ObjectType = Image<br>
NDims = 3<br>
BinaryData = True<br>
BinaryDataByteOrderMSB = False<br>
CompressedData = True<br>
TransformMatrix = 1 0 0 0 1 0 0 0 1<br>
Offset = 0 0 0<br>
CenterOfRotation = 0 0 0<br>
ElementSpacing = 1 1 1<br>
DimSize = 0 0 0<br>
AnatomicalOrientation = ???<br>
ElementType = MET_UCHAR<br>
ElementDataFile = test.zraw<br>
<br>
Von: Joachim Pouderoux [mailto:<a href="mailto:joachim.pouderoux@kitware.com">joachim.pouderoux@<wbr>kitware.com</a>]<br>
Gesendet: Donnerstag, 12. Jänner 2017 22:28<br>
An: Lodron, Gerald<br>
Cc: Paraview Developer (<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.<wbr>org</a>); Paraview User (<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>)<br>
Betreff: Re: [Paraview-developers] [Paraview] vtkImageData Plugin, vtkImageData not rendered<br>
<br>
OK. That's weired, your VTI is correct.<br>
And what if you save the output of your filter/reader with ParaView "Save Data"? Is data correctly saved and reloaded correctly?<br>
Joachim<br>
<br>
<br>
Joachim Pouderoux, PhD<br>
Technical Expert - Scientific Computing Team<br>
Kitware SAS<br>
<br>
2017-01-11 8:14 GMT-04:00 Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>:<br>
i have uploaded the vti onto<br>
<a href="https://expirebox.com/download/60e7c1e8d177f282ae90d42f75e5ae50.html" rel="noreferrer" target="_blank">https://expirebox.com/<wbr>download/<wbr>60e7c1e8d177f282ae90d42f75e5ae<wbr>50.html</a><br>
the link is 48h accessible<br>
<br>
when I load the vti into paraview everything is visualized correctly<br>
<br>
Von: Paraview-developers [mailto:<a href="mailto:paraview-developers-bounces@paraview.org">paraview-developers-<wbr>bounces@paraview.org</a>] Im Auftrag von Lodron, Gerald<br>
Gesendet: Mittwoch, 11. Jänner 2017 12:07<br>
<br>
An: Joachim Pouderoux<br>
Cc: Paraview Developer (<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.<wbr>org</a>); Paraview User (<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>)<br>
Betreff: Re: [Paraview-developers] [Paraview] vtkImageData Plugin, vtkImageData not rendered<br>
<br>
Sorry for my late reply:<br>
<br>
“21745593” is correct, that’s the UID string of the sensor/camera which generates the vtkImagedata, I set the string from its SDK…. I will try writing the vti file for you….<br>
<br>
<br>
<br>
Von: Joachim Pouderoux [mailto:<a href="mailto:joachim.pouderoux@kitware.com">joachim.pouderoux@<wbr>kitware.com</a>]<br>
Gesendet: Dienstag, 10. Jänner 2017 19:09<br>
An: Lodron, Gerald<br>
Cc: Paraview Developer (<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.<wbr>org</a>); Paraview User (<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>)<br>
Betreff: Re: [Paraview-developers] [Paraview] vtkImageData Plugin, vtkImageData not rendered<br>
<br>
Hmm sorry if I had took a closer look I would have seen that AllocateScalars set a default name "ImageScalars" to the scalar array.<br>
Then don't know what you did but the print says that the name of your array is "21745593" which is quite strange. Is it what you did?<br>
Could you write your "output" image data to a .VTI file using a vtkXMLImageDataWriter after initializing it in your RequestData<br>
function and see if you can load in with PV and view it? Share it if you can't.<br>
Best,<br>
<br>
<br>
Joachim Pouderoux, PhD<br>
Technical Expert - Scientific Computing Team<br>
Kitware SAS<br>
<br>
2017-01-10 2:00 GMT-04:00 Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>:<br>
Here i printed my vtkImageDataOutput of my plugin in Request data, may that helps…:<br>
<br>
output vtkImageData (00000087ABEB1260)<br>
Debug: Off<br>
Modified Time: 870183<br>
Reference Count: 1<br>
Registered Events: (none)<br>
Information: 00000087AC049A90<br>
Data Released: False<br>
Global Release Data: Off<br>
UpdateTime: 195896<br>
Field Data:<br>
Debug: Off<br>
Modified Time: 870094<br>
Reference Count: 1<br>
Registered Events: (none)<br>
Number Of Arrays: 0<br>
Number Of Components: 0<br>
Number Of Tuples: 0<br>
Number Of Points: 1920000<br>
Number Of Cells: 1917201<br>
Cell Data:<br>
Debug: Off<br>
Modified Time: 870179<br>
Reference Count: 1<br>
Registered Events:<br>
Registered Observers:<br>
vtkObserver (00000087ABC476A0)<br>
Event: 33<br>
EventName: ModifiedEvent<br>
Command: 00000087AC0495E0<br>
Priority: 0<br>
Tag: 1<br>
Number Of Arrays: 0<br>
Number Of Components: 0<br>
Number Of Tuples: 0<br>
Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )<br>
Interpolate Flags: ( 1 1 1 1 1 0 0 1 )<br>
Pass Through Flags: ( 1 1 1 1 1 1 1 1 )<br>
Scalars: (none)<br>
Vectors: (none)<br>
Normals: (none)<br>
TCoords: (none)<br>
Tensors: (none)<br>
GlobalIds: (none)<br>
PedigreeIds: (none)<br>
EdgeFlag: (none)<br>
Point Data:<br>
Debug: Off<br>
Modified Time: 870183<br>
Reference Count: 1<br>
Registered Events:<br>
Registered Observers:<br>
vtkObserver (00000087ABC475B0)<br>
Event: 33<br>
EventName: ModifiedEvent<br>
Command: 00000087AC0495E0<br>
Priority: 0<br>
Tag: 1<br>
Number Of Arrays: 1<br>
Array 0 name = 21745593<br>
Number Of Components: 1<br>
Number Of Tuples: 1920000<br>
Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )<br>
Interpolate Flags: ( 1 1 1 1 1 0 0 1 )<br>
Pass Through Flags: ( 1 1 1 1 1 1 1 1 )<br>
Scalars:<br>
Debug: Off<br>
Modified Time: 870148<br>
Reference Count: 2<br>
Registered Events: (none)<br>
Name: 21745593<br>
Data type: unsigned char<br>
Size: 1920000<br>
MaxId: 1919999<br>
NumberOfComponents: 1<br>
Information: 0000000000000000<br>
Name: 21745593<br>
Number Of Components: 1<br>
Number Of Tuples: 1920000<br>
Size: 1920000<br>
MaxId: 1919999<br>
LookupTable: (none)<br>
Vectors: (none)<br>
Normals: (none)<br>
TCoords: (none)<br>
Tensors: (none)<br>
GlobalIds: (none)<br>
PedigreeIds: (none)<br>
EdgeFlag: (none)<br>
Bounds:<br>
Xmin,Xmax: (0, 1599)<br>
Ymin,Ymax: (0, 1199)<br>
Zmin,Zmax: (0, 0)<br>
Compute Time: 870184<br>
Spacing: (1, 1, 1)<br>
Origin: (0, 0, 0)<br>
Dimensions: (1600, 1200, 1)<br>
Increments: (0, 0, 0)<br>
Extent: (0, 1599, 0, 1199, 0, 0)<br>
<br>
<br>
<br>
<br>
<br>
<br>
Von: Paraview-developers [mailto:<a href="mailto:paraview-developers-bounces@paraview.org">paraview-developers-<wbr>bounces@paraview.org</a>] Im Auftrag von Lodron, Gerald<br>
Gesendet: Dienstag, 10. Jänner 2017 06:49<br>
An: Joachim Pouderoux<br>
Cc: Paraview Developer (<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.<wbr>org</a>); Paraview User (<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>)<br>
Betreff: Re: [Paraview-developers] [Paraview] vtkImageData Plugin, vtkImageData not rendered<br>
<br>
Hi<br>
<br>
Good try but does not effect anything except the string in paraview’s combo box. The strange thing is that I also cannot see anything in spreadsheet view (empty cell and point data)… but on information tab point data and cell data is there….<br>
<br>
Von: Joachim Pouderoux [mailto:<a href="mailto:joachim.pouderoux@kitware.com">joachim.pouderoux@<wbr>kitware.com</a>]<br>
Gesendet: Montag, 09. Jänner 2017 19:40<br>
An: Lodron, Gerald<br>
Cc: Paraview User (<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>); Paraview Developer (<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.<wbr>org</a>)<br>
Betreff: Re: [Paraview] vtkImageData Plugin, vtkImageData not rendered<br>
<br>
Hi Gerald,<br>
Not sure it is the only issue but please try giving a name to the output scalar arrays.<br>
ParaView won't make visible arrays which don't have a name.<br>
Example:<br>
output->GetPointData()-><wbr>GetScalars()->SetName("values"<wbr>);<br>
Best,<br>
<br>
<br>
Joachim Pouderoux, PhD<br>
Technical Expert - Scientific Computing Team<br>
Kitware SAS<br>
<br>
2017-01-09 5:20 GMT-04:00 Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>:<br>
Hi<br>
<br>
I programmed successfully a plugin source wich generates a vtkImageData output and made it the same way as on my 3d cloud plugins of vtkPolyData. The source is inherited from vtkImageAlgorithm and only contains one output with unsigned char array and one component.<br>
<br>
In the request data function of the filter I currently have a very dummy:<br>
<br>
output->SetDimensions(oData.<wbr>imgSizeX, oData.imgSizeY, 1);<br>
output ->AllocateScalars(VTK_<wbr>UNSIGNED_CHAR, 1);<br>
memcpy(output ->GetScalarPointer(), &oData.imgData[0], oData.imgSizeX* oData.imgSizeY*sizeof(unsigned char));<br>
<br>
in paraview I see in the information tab that I have an uniform rectilinear grid with 1917201 cells and 1920000 points (image is 1600*1200px). In data Arrays I get an "ImageScalars" of unsigned char and a correct range of my memcopy data (my min max range is not 0,255 so data seems to be there)...<br>
<br>
the problem is that I cannot see anything in the render view, any suggestions what I am making wrong? I tested all representation (slice, surface, outline, on Solid Color and on my array), never see anything.....<br>
<br>
I also compared the Information tab on a loaded jpeg image and cannot see any difference (which is rendered in render view except the Array's string name), by the way: can I disable "MapScalars" by default?<br>
<br>
I am using pv5.2<br>
<br>
------------------------------<wbr>------------------------------<wbr>------------------------<br>
Gerald Lodron<br>
<br>
Researcher of Machine Vision Applications Group<br>
DIGITAL - Institute for Information and Communication Technologies<br>
<br>
JOANNEUM RESEARCH Forschungsgesellschaft mbH<br>
Steyrergasse 17, 8010 Graz, AUSTRIA<br>
<br>
phone: +43-316-876-1751 <br>
general fax: +43-316-876-1751<br>
web: <a href="http://www.joanneum.at/digital" rel="noreferrer" target="_blank">http://www.joanneum.at/digital</a><br>
e-mail: <a href="mailto:gerald.lodron@joanneum.at">gerald.lodron@joanneum.at</a><br>
<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/<wbr>ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/paraview</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>