CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Creating VTK image compatible to Paraview Visualizer

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2016, 09:20
Question Creating VTK image compatible to Paraview Visualizer
  #1
het
New Member
 
Het
Join Date: Jan 2016
Posts: 2
Rep Power: 0
het is on a distinguished road
Hi,

I am newbie in ParaviewWeb. I have a requirement to show 3D VTK image in web browser.
Using ParaviewWeb, I am able to open the visualizer app provided in browser and sample 3D vtk image data are also working.

I have to show vtk images created programmatically by us.
My problem is proammatically created vtk images are not opening in Paraview visualizer.

I am using Kitware library to create vtk images in c#. Below is my code to generate vtk image. Please help me find where I am doing wrong?
private void create3DImage(int Zframes)
{
try
{
vtkRenderer render = _renderControl.RenderWindow.GetRenderers().GetFirs tRenderer();
render.RemoveAllViewProps();

string parent = Environment.CurrentDirectory;

vtkJPEGReader jpegReader = vtkJPEGReader.New();
jpegReader.SetFilePattern("%s%d.jpg");
jpegReader.SetFilePrefix(parent + @"\tmp\test");
jpegReader.SetDataExtent(0, 511, 0, 511, 1, Zframes);
jpegReader.SetDataSpacing(1, 1, 10);
jpegReader.SetDataScalarTypeToUnsignedChar();

vtkColorTransferFunction red = vtkColorTransferFunction.New();
red.AddRGBPoint(0.0, 0.0, 0.0, 0.0);
red.AddRGBPoint(255.0, 1.0, 0.0, 0.0);

vtkColorTransferFunction green = vtkColorTransferFunction.New();
green.AddRGBPoint(0.0, 0.0, 0.0, 0.0);
green.AddRGBPoint(255.0, 0.0, 1.0, 0.0);

vtkColorTransferFunction blue = vtkColorTransferFunction.New();
blue.AddRGBPoint(0.0, 0.0, 0.0, 0.0);
blue.AddRGBPoint(255.0, 0.0, 0.0, 1.0);

vtkVolumeProperty volumeProperty = vtkVolumeProperty.New();
volumeProperty.SetInterpolationTypeToLinear();
volumeProperty.SetColor(0, red);
volumeProperty.SetColor(1, green);
volumeProperty.SetColor(2, blue);

vtkSmartVolumeMapper volumeMapper = vtkSmartVolumeMapper.New();
volumeMapper.SetBlendModeToComposite();
volumeMapper.SetInput(jpegReader.GetOutput());

vtkVolume volume = vtkVolume.New();
volume.SetMapper(volumeMapper);
volume.SetProperty(volumeProperty);

/***********************/
vtkXMLImageDataWriter writer = vtkXMLImageDataWriter.New();
writer.SetFileName("D:/VTK/test.vtk");
writer.SetInput(jpegReader.GetOutput());
writer.Write();

vtkImageData imageData = vtkImageData.New();
imageData.SetNumberOfScalarComponents(1);
imageData.SetScalarTypeToDouble();
imageData.AllocateScalars();
/***********************/


}
catch (Exception ex)
{
utility.ShowAndLogError(ex, "Error occured in creating 3D Image!");
}
}

I can show this vtk image in windows application using kitware vtk library code but its not opening in Web application using ParaviewWeb Visualizer.

Thanks..
het is offline   Reply With Quote

Reply

Tags
kitware, paraview, paraviewweb, vtk, vtkfiles

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Creating an average line in paraView kayoneex ParaView 14 September 21, 2020 08:46
Cht tutorial in 15 braennstroem OpenFOAM Running, Solving & CFD 197 June 10, 2015 04:02
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 18:51
Newbie: Install ParaView 3.81 on OF-1.6-ext/OpenSuse 11.2? lentschi OpenFOAM Installation 1 March 9, 2011 03:32
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 22:41


All times are GMT -4. The time now is 06:35.