[Paraview] Fwd: Image Doesn't load correctly
Dean, Kevin
kevin.dean at decisionsciencescorp.com
Tue May 5 19:39:25 EDT 2015
nevermind, I figured it out.
the xml I had didn't like having a documentation section within the string
vector property
Kevin
On Tue, May 5, 2015 at 4:31 PM, Dean, Kevin <
kevin.dean at decisionsciencescorp.com> wrote:
> ok, now I am getting new and exciting error messages for loading the
> plugin... it doesn't seem to enjoy this line from the XML
>
> <FileListDomain name="files"/>
>
> errors:
>
> ERROR: In
> /home/kdean/tmp/install_PV_source/ParaView/VTK/IO/XMLParser/vtkXMLParser.cxx,
> line 483
> vtkPVXMLParser (0x35d8d20): Error parsing XML in stream at line 18, column
> 8, byte index 632: not well-formed (invalid token)
>
>
> ERROR: In
> /home/kdean/tmp/install_PV_source/ParaView/VTK/IO/XMLParser/vtkXMLParser.cxx,
> line 483
> vtkPVXMLParser (0x238f5a0): Error parsing XML in stream at line 18, column
> 8, byte index 632: not well-formed (invalid token)
>
>
> ERROR: In
> /home/kdean/tmp/install_PV_source/ParaView/ParaViewCore/ServerImplementation/Core/vtkSIProxyDefinitionManager.cxx,
> line 565
> vtkSIProxyDefinitionManager (0x1815770): No proxy that matches:
> group=sources and proxy=vtkPVPROTOImageReader were found.
>
> Error opening file ".../protobuf."
>
> Kevin E. Dean
>
> On Tue, May 5, 2015 at 10:12 AM, Burlen Loring <bloring at lbl.gov> wrote:
>
>> at the moment I do not implement that.
>>
>> this may be the source of your issues, I thought that if you don't return
>> 1 from this function PV will assume your reader is not the right one and
>> skip it(ie never call SetFileName). But if that were really true I don't
>> get how RequestData is getting called...
>>
>>
>>
>> On 05/05/2015 10:00 AM, Dean, Kevin wrote:
>>
>> at the moment I do not implement that. I am assuming that may be the
>> reason why I get this message every time i load the shared object file...
>>
>> ERROR: In
>> /home/kdean/tmp/install_PV_source/ParaView/ParaViewCore/ServerManager/Core/vtkSMProperty.cxx,
>> line 552
>> vtkSMStringVectorProperty (0x3cb10f0): Could not create object of type:
>> vtkSMFileListDoman. Did you specify wrong xml element?
>>
>> On Tue, May 5, 2015 at 9:14 AM, Burlen Loring <bloring at lbl.gov> wrote:
>>
>>> ParaView should set it after it determines if the reader can read it.
>>> Did you also implement CanReadFile? Maybe the problem is in that function.
>>>
>>>
>>> On 05/05/2015 09:09 AM, Dean, Kevin wrote:
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Dean, Kevin <kevin.dean at decisionsciencescorp.com>
>>> Date: Mon, May 4, 2015 at 5:10 PM
>>> Subject: Re: [Paraview] Image Doesn't load correctly
>>> To: Burlen Loring <burlen.loring at gmail.com>
>>>
>>>
>>> awesome, thanks, that did it.
>>>
>>> One more question. Is there a way to debug the FileName aspect of the
>>> reader. I can't figure out how it's supposed to get set. The only way I can
>>> get the image to show is by hard
>>> coding it within the RequestData() function.
>>>
>>> Thanks Again
>>>
>>> Kevin E. Dean
>>>
>>> On Mon, May 4, 2015 at 11:33 AM, Burlen Loring <burlen.loring at gmail.com>
>>> wrote:
>>>
>>>> Hi Kevin.
>>>>
>>>> Your RequestInformation looks a little bare. Unless things have changed
>>>> recently, you might need to set WHOLE_EXTENT, ORIGIN, SPACING,
>>>> CAN_PRODUCE_SUB_EXTENT keys there. and if you support parallel IO honor the
>>>> requested extent in RequestData.
>>>>
>>>> Burlen
>>>>
>>>>
>>>> On 05/04/2015 09:52 AM, Dean, Kevin wrote:
>>>>
>>>> So I am still having a few issues with the reader. I have checked
>>>> the output from the information Panel. And it seems as if all the
>>>> information is the same. So maybe the data is getting deleted somehow (I'm
>>>> not sure...., but here is a snippet of my code);
>>>>
>>>> int vtkPVPROTOImageReader::RequestInformation (
>>>> vtkInformation*,
>>>> vtkInformationVector**,
>>>> vtkInformationVector* outputVector)
>>>> {
>>>> vtkInformation* outInfo = outputVector->GetInformationObject(0);
>>>> vtkDataObject::SetPointDataActiveScalarInfo(outInfo,
>>>> VTK_UNSIGNED_CHAR, 1);
>>>>
>>>> return 1;
>>>> }
>>>>
>>>> int vtkPVPROTOImageReader::RequestData(vtkInformation
>>>> *vtkNotUsed(request),
>>>> vtkInformationVector
>>>> **inputVector,
>>>> vtkInformationVector
>>>> *outputVector)
>>>> {
>>>> ... conversion code from protobuf
>>>>
>>>> /* Convert from protobuf to vtkImageData */
>>>> vtkSmartPointer<vtkImageData> image = "function converting to
>>>> protobuf";
>>>>
>>>> vtkDataArray* scalars = image->GetPointData()->GetScalars();
>>>> scalars->SetName("ReconstructionData");
>>>>
>>>> /* Get the info object */
>>>> vtkInformation *outInfo = outputVector->GetInformationObject(0);
>>>> outInfo->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkImageData");
>>>>
>>>> /* Get the output */
>>>> vtkImageData* output = vtkImageData::GetData(outputVector);
>>>>
>>>> // output->SetSpacing(image->GetSpacing());
>>>> // output->SetOrigin(image->GetOrigin());
>>>> // output->AllocateScalars(outInfo);
>>>> //
>>>> output->GetPointData()->SetScalars(image->GetPointData()->GetScalars());
>>>> // output->SetDimensions(image->GetDimensions());
>>>>
>>>> output->ShallowCopy(image);
>>>>
>>>> int* dimensions = output->GetDimensions();
>>>>
>>>> std::cout << "\nNumber of points: " << output->GetNumberOfPoints() <<
>>>> std::endl;
>>>> std::cout << "Number of cells: " << output->GetNumberOfCells() <<
>>>> "\n" << std::endl;
>>>>
>>>> // print out the pixel values to see if they are actually present
>>>> for (int z = 0; z < dimensions[2]; z++)
>>>> {
>>>> for (int y = 0; y < dimensions[1]; y++)
>>>> {
>>>> for (int x = 0; x < dimensions[0]; x++)
>>>> {
>>>> double* pixel =
>>>> static_cast<double*>(output->GetScalarPointer(x,y,z));
>>>> // do something with v
>>>> std::cout << "pixel value: " << pixel[0] << "\n";
>>>> }
>>>> std::cout << std::endl;
>>>> }
>>>> std::cout << std::endl;
>>>> }
>>>>
>>>> // write output to file and compare in visualization window...
>>>> vtkSmartPointer<vtkXMLImageDataWriter> vtk_writer =
>>>> vtkSmartPointer<vtkXMLImageDataWriter>::New();
>>>> vtk_writer->SetInputData(output);
>>>> vtk_writer->SetFileName( "/home/kdean/tmp/foo.vti" );
>>>> vtk_writer->Update();
>>>> vtk_writer->Write();
>>>>
>>>> return 1;
>>>> }
>>>>
>>>>
>>>> Another Problem I ran into:
>>>> So I had to hardcode a file for the char *FileName into the
>>>> RequestData Function in order to read any protobuf file. I ran a debugger
>>>> on the code, and it seems like these functions from the header file (of the
>>>> reader):
>>>>
>>>> vtkGetStringMacro(FileName);
>>>> vtkSetStringMacro(FileName);
>>>>
>>>> they are never getting called.
>>>>
>>>> Thanks,
>>>>
>>>> Kevin
>>>>
>>>> here are my xml too... it looks right, but maybe I am missing
>>>> something.
>>>>
>>>> On Sun, May 3, 2015 at 7:04 AM, Utkarsh Ayachit <
>>>> utkarsh.ayachit at kitware.com> wrote:
>>>>
>>>>> You can also use the Information panel to see what arrays are being
>>>>> read in and what their ranges are.
>>>>>
>>>>> On Sat, May 2, 2015 at 7:06 PM, Dean, Kevin
>>>>> <kevin.dean at decisionsciencescorp.com> wrote:
>>>>> > looked at the spreadsheet view in the GUI, and it looks like none of
>>>>> the
>>>>> > Point Data is actually being copied...
>>>>> >
>>>>> > On Sat, May 2, 2015 at 3:44 PM, Dean, Kevin
>>>>> > <kevin.dean at decisionsciencescorp.com> wrote:
>>>>> >>
>>>>> >> What's up Utkarsh?
>>>>> >>
>>>>> >> So I was able to write that plugin and convert my image to the
>>>>> >> vtkImageData. However, I am having trouble visualizing the image.
>>>>> However,
>>>>> >> when I write out the output from my reader, the image gets written
>>>>> >> correctly... Here are some pictures to show the differences. (All
>>>>> the
>>>>> >> information for the images is exactly the same) Do you have an idea
>>>>> of how I
>>>>> >> can try to fix it? Thanks.
>>>>> >>
>>>>> >> Kevin E. Dean
>>>>> >
>>>>> >
>>>>> >
>>>>> > This email and its contents are confidential. If you are not the
>>>>> intended
>>>>> > recipient, please do not disclose or use the information within this
>>>>> email
>>>>> > or its attachments. If you have received this email in error, please
>>>>> report
>>>>> > the error to the sender by return email and delete this
>>>>> communication from
>>>>> > your records.
>>>>>
>>>>
>>>>
>>>> This email and its contents are confidential. If you are not the
>>>> intended recipient, please do not disclose or use the information within
>>>> this email or its attachments. If you have received this email in error,
>>>> please report the error to the sender by return email and delete this
>>>> communication from your records.
>>>>
>>>> _______________________________________________
>>>> 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 ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>>>
>>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>>
>>>> Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/paraview
>>>>
>>>>
>>>>
>>>
>>>
>>> This email and its contents are confidential. If you are not the
>>> intended recipient, please do not disclose or use the information within
>>> this email or its attachments. If you have received this email in error,
>>> please report the error to the sender by return email and delete this
>>> communication from your records.
>>>
>>> _______________________________________________
>>> 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 ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>>
>>
>> This email and its contents are confidential. If you are not the intended
>> recipient, please do not disclose or use the information within this email
>> or its attachments. If you have received this email in error, please report
>> the error to the sender by return email and delete this communication from
>> your records.
>>
>>
>>
>
--
This email and its contents are confidential. If you are not the intended
recipient, please do not disclose or use the information within this email
or its attachments. If you have received this email in error, please report
the error to the sender by return email and delete this communication from
your records.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150505/fe5e5a71/attachment.html>
More information about the ParaView
mailing list