[vtkusers] Problems in accessing point data
rahul indoria
rahulindoria5 at gmail.com
Mon Jul 22 07:01:42 EDT 2013
Hi,
I have an example (
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvedReformation ),
and i am modifying this example, i am trying to find the point data on the
data, i have modified this code, in that way which i am showing, but i am
getting some unexpected pointdata values which are nearly zero and which is
not possible. could you please suggest me some solution regarding this?
static vtkSmartPointer<vtkPolyData> SweepLine (vtkPolyData *line,
double direction[3],
double distance,
unsigned int cols);
int main (int argc, char *argv[])
{
// Verify arguments
if (argc < 4)
{
std::cout << "Usage: " << argv[0]
<< " InputVolume PolyDataInput"
<< " Resolution"
<< std::endl;
return EXIT_FAILURE;
}
// Parse arguments
std::string volumeFileName = argv[1];
std::string polyDataFileName = argv[2];
std::stringstream ssResolution;
ssResolution << argv[3];
unsigned int resolution;
ssResolution >> resolution;
// Output arguments
std::cout << "InputVolume: " << volumeFileName << std::endl
<< "PolyDataInput: " << polyDataFileName << std::endl
<< "Resolution: " << resolution << std::endl;
// Read the volume data
vtkSmartPointer< vtkImageReader2Factory > imageFactory =
vtkSmartPointer< vtkImageReader2Factory >::New();
vtkImageReader2 *imageReader =
imageFactory->CreateImageReader2(volumeFileName.c_str());
imageReader->SetFileName(volumeFileName.c_str());
imageReader->Update();
// Read the Polyline
vtkSmartPointer<vtkPolyDataReader> polyLineReader =
vtkSmartPointer<vtkPolyDataReader>::New();
polyLineReader->SetFileName(polyDataFileName.c_str());
polyLineReader->Update();
vtkSmartPointer<vtkSplineFilter> spline =
vtkSmartPointer<vtkSplineFilter>::New();
spline->SetInputConnection(polyLineReader->GetOutputPort());
spline->SetSubdivideToSpecified();
spline->SetNumberOfSubdivisions(resolution);
// Sweep the line to form a surface
double direction[3];
direction[0] = 0.0;
direction[1] = 0.0;
direction[2] = 1.0;
double distance = 164;
spline->Update();
vtkSmartPointer<vtkPolyData> surface =
SweepLine(spline->GetOutput(),
direction,
distance,
atoi(argv[3]));
// Probe the volume with the extruded surface
vtkSmartPointer<vtkProbeFilter> sampleVolume =
vtkSmartPointer<vtkProbeFilter>::New();
sampleVolume->SetInputConnection(1, imageReader->GetOutputPort());
#if VTK_MAJOR_VERSION <= 5
sampleVolume->SetInput(0, surface);
#else
sampleVolume->SetInputData(0, surface);
#endif
// Compute a simple window/level based on scalar range
vtkSmartPointer<vtkWindowLevelLookupTable> wlLut =
vtkSmartPointer<vtkWindowLevelLookupTable>::New();
double range = imageReader->GetOutput()->GetScalarRange()[1] -
imageReader->GetOutput()->GetScalarRange()[0];
double level = (imageReader->GetOutput()->GetScalarRange()[1] +
imageReader->GetOutput()->GetScalarRange()[0]) / 2.0;
wlLut->SetWindow(range);
wlLut->SetLevel(level);
sampleVolume->Update();
*// From Here i have done modification in my code.*
// To find out the Pointdata of a surface
// Extract the polydata
vtkSmartPointer<vtkPolyData> polydata =
vtkSmartPointer<vtkPolyData> :: New();
polydata = vtkPolyData::SafeDownCast(sampleVolume->GetOutput());
// Get the number of points in the polydata
vtkIdType idNumPointsInFile = polydata->GetNumberOfPoints();
vtkSmartPointer<vtkDoubleArray> array = vtkSmartPointer<vtkDoubleArray>
:: New();
// array->SetName("Double");
array->SetNumberOfTuples(idNumPointsInFile);
polydata->GetPointData()->AddArray(array);
// array =
vtkDoubleArray::SafeDownCast(polydata->GetPointData()->GetArray("Double"));
if(array)
{
for(int i = 0; i < idNumPointsInFile; i++)
{
std::cout << "Got array.= " << i << std::endl;
double dist;
dist = array->GetValue(i);
// if the array held arrays instead of scalars, you would use this:
// double location[3];
// array->GetTupleValue(i, location);
// std::cout << "Location: " << Location[0] << "," << Location[1] <<
"," << Location[2] << std::endl;
std::cout << "Distance: " << dist << std::endl;
}
} //end if(array)
else
{
std::cout << "no array." << std::endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
On Sun, Jul 21, 2013 at 6:00 PM, <vtkusers-request at vtk.org> wrote:
> Send vtkusers mailing list submissions to
> vtkusers at vtk.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.vtk.org/mailman/listinfo/vtkusers
> or, via email, send a message with subject or body 'help' to
> vtkusers-request at vtk.org
>
> You can reach the person managing the list at
> vtkusers-owner at vtk.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vtkusers digest..."
>
>
> Today's Topics:
>
> 1. Cocoa build instructions a little out of date (David Clunie)
> 2. Some tests fail compiling 5.10.0 on MacOS Cocoa (David Clunie)
> 3. Missing tag for release 5.9.0 in github? (David Clunie)
> 4. Re: Missing tag for release 5.9.0 in github? (David Gobbi)
> 5. Problem in Read Dicom Series (Vachik Dave)
> 6. Re: Problem in Read Dicom Series (Marco Sambin)
> 7. Re: Problem in Read Dicom Series (David Gobbi)
> 8. Re: mapping floating image to color image using
> vtkImageMapToColors (Richard Frank)
> 9. Re: Problem in Read Dicom Series (Vachik Dave)
> 10. Re: Problem in Read Dicom Series (Marco Sambin)
> 11. smapersmaper (max perlman)
> 12. Agata Krason (Agata Kraso?)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 20 Jul 2013 13:09:14 -0400
> From: David Clunie <dclunie at dclunie.com>
> Subject: [vtkusers] Cocoa build instructions a little out of date
> To: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID: <51EAC43A.1090808 at dclunie.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> The instructions at "http://www.vtk.org/Wiki/Cocoa_VTK" are helpful,
> but a little dated.
>
> For more recent MacOS/Xcode versions, for "CMAKE_OSX_SYSROOT:STRING",
> the SDKs no longer live in "/Developer", but rather inside the XCode
> package.
>
> E.g., to target 10.7 one needs
>
>
>
> "CMAKE_OSX_SYSROOT:STRING=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"
>
> Also, a "~" will not work in the "CMAKE_INSTALL_PREFIX:PATH"
>
> also, "CMAKE_CXX_FLAGS:STRING=-Wno-deprecated", helps clear things
> up, since otherwise the MacOs headers generate a lot of warnings.
>
> David
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 20 Jul 2013 13:05:18 -0400
> From: David Clunie <dclunie at dclunie.com>
> Subject: [vtkusers] Some tests fail compiling 5.10.0 on MacOS Cocoa
> To: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID: <51EAC34E.6040505 at dclunie.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi
>
> "make test" after compiling for Cocoa on MacOS 10.8.4 for target 10.7
> with Xcode 4.6.2 with architectures "i386;x86_64" had a few failures:
>
> 98% tests passed, 5 tests failed out of 299
>
> The following tests FAILED:
> 85 - CellLocator (Failed)
> 213 - TestAffineWidget (Failed)
> 214 - TestButtonWidget (SEGFAULT)
> 216 - TestLogoWidget (Failed)
> 218 - TestPolyPlane (OTHER_FAULT)
>
> David
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 20 Jul 2013 13:02:13 -0400
> From: David Clunie <dclunie at dclunie.com>
> Subject: [vtkusers] Missing tag for release 5.9.0 in github?
> To: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID: <51EAC295.4090704 at dclunie.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I wanted to compile VTK for Osirix 5.6, and they seem to use 5.9.0,
> but if I look in github there seems to be no such tag.
>
> There is 5.8.0 and 5.10.0 and some v5.10.0 release candidates, but
> no 5.9.0.
>
> David
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 20 Jul 2013 11:44:36 -0600
> From: David Gobbi <david.gobbi at gmail.com>
> Subject: Re: [vtkusers] Missing tag for release 5.9.0 in github?
> To: David Clunie <dclunie at dclunie.com>
> Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID:
> <CANwS1=
> GbH-n4GC50bB8HTc0xU1LEbyMwumxwQ-d6rV5bYJp9cQ at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi David,
>
> Welcome to the VTK mailing list.
>
> Odd minor version numbers in VTK 4 and 5 were used to indicate the cvs
> development branch (similar to the way Linux only used even numbers
> for releases). So VTK 5.9 was the development branch that evolved
> into the VTK 5.10 release. The best release for you to use is
> probably the VTK 5.10.1 release.
>
> - David
>
> On Sat, Jul 20, 2013 at 11:02 AM, David Clunie <dclunie at dclunie.com>
> wrote:
> > I wanted to compile VTK for Osirix 5.6, and they seem to use 5.9.0,
> > but if I look in github there seems to be no such tag.
> >
> > There is 5.8.0 and 5.10.0 and some v5.10.0 release candidates, but
> > no 5.9.0.
> >
> > David
>
>
> ------------------------------
>
> Message: 5
> Date: Sat, 20 Jul 2013 14:59:07 -0400
> From: Vachik Dave <vsdave at umail.iu.edu>
> Subject: [vtkusers] Problem in Read Dicom Series
> To: vtkusers at vtk.org
> Message-ID:
> <CADB4r1=
> 3qVTdg7mcG73s6nC27A8uit2pmrAVU3fKhBcMEE184g at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I need to read 99 image slices of .tif format. but I found this option with
> dicom files.
> So I converted my .tif files into .dcm file using Matlab.
>
> I am using example available at
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOMSeries
> Now my problem is that the same project working for other Dicom folder is
> not working for my Matlab generated files.
> It shows only one slice as a result.
>
> Any clue, what is wrong and how can I make it work?
>
>
> Thanks in advance.
> *
> --Vachik
> *
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130720/ea6389bd/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 6
> Date: Sat, 20 Jul 2013 21:09:25 +0200
> From: Marco Sambin <m.sambin at gmail.com>
> Subject: Re: [vtkusers] Problem in Read Dicom Series
> To: vtkusers at vtk.org
> Message-ID:
> <CAFoCWhtSLmg1582H=mp62mDEvmxMC=
> nU776kUMVjy568k1YzFg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Vachik,
>
> well, I'm not sure how you converted TIF to DICOM, but I guess you
> generated Secondary Capture DICOM files which do not contain Image
> Position, Image Orientation and Pixel Spacing data elements (since this
> info is absent in your source TIF image files).
>
> Hence, the reader cannot generate a correct volume without knowing those
> data.
>
> Best regards,
>
> Marco
> Il giorno 20/lug/2013 20:59, "Vachik Dave" <vsdave at umail.iu.edu> ha
> scritto:
>
> > I need to read 99 image slices of .tif format. but I found this option
> > with dicom files.
> > So I converted my .tif files into .dcm file using Matlab.
> >
> > I am using example available at
> > http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOMSeries
> > Now my problem is that the same project working for other Dicom folder is
> > not working for my Matlab generated files.
> > It shows only one slice as a result.
> >
> > Any clue, what is wrong and how can I make it work?
> >
> >
> > Thanks in advance.
> > *
> > --Vachik
> > *
> >
> > _______________________________________________
> > 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
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130720/f53a5124/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 7
> Date: Sat, 20 Jul 2013 13:18:54 -0600
> From: David Gobbi <david.gobbi at gmail.com>
> Subject: Re: [vtkusers] Problem in Read Dicom Series
> To: VTK Users <vtkusers at vtk.org>
> Message-ID:
> <CANwS1=
> Hy6236vneOgKEwZch8tBNSFDr92wtfMtAGBngUTj-95g at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> VTK has a TIF reader (vtkTIFFReader). Why not just use that?
>
> On Sat, Jul 20, 2013 at 1:09 PM, Marco Sambin <m.sambin at gmail.com> wrote:
> > Hi Vachik,
> >
> > well, I'm not sure how you converted TIF to DICOM, but I guess you
> generated
> > Secondary Capture DICOM files which do not contain Image Position, Image
> > Orientation and Pixel Spacing data elements (since this info is absent in
> > your source TIF image files).
> >
> > Hence, the reader cannot generate a correct volume without knowing those
> > data.
> >
> > Best regards,
> >
> > Marco
> >
> > Il giorno 20/lug/2013 20:59, "Vachik Dave" <vsdave at umail.iu.edu> ha
> scritto:
> >>
> >> I need to read 99 image slices of .tif format. but I found this option
> >> with dicom files.
> >> So I converted my .tif files into .dcm file using Matlab.
> >>
> >> I am using example available at
> >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOMSeries
> >> Now my problem is that the same project working for other Dicom folder
> is
> >> not working for my Matlab generated files.
> >> It shows only one slice as a result.
> >>
> >> Any clue, what is wrong and how can I make it work?
> >>
> >>
> >> Thanks in advance.
> >>
> >> --Vachik
>
>
> ------------------------------
>
> Message: 8
> Date: Sat, 20 Jul 2013 19:23:04 +0000 (GMT)
> From: Richard Frank <rickfrank at me.com>
> Subject: Re: [vtkusers] mapping floating image to color image using
> vtkImageMapToColors
> To: Bill Lorensen <bill.lorensen at gmail.com>
> Cc: VTK Users <vtkusers at vtk.org>
> Message-ID: <8b155350-acde-462e-b085-40145fc954fa at me.com>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> Hi Bill,
>
> The code below will illustrate the issue.
>
> If you enable the color mapping code, by setting the #if 0 to #if 1, you
> will find that the color is a washed out white.
>
> My desire is to have a ramp on a single hue, based on gray levels.
>
> My data is typically from 0 - 0.69 which is what I set it to. The actual
> range is 0.0 ?- 1.0. but it pretty much never gets above
> 0.69.
>
> I think the problem is perhaps not understanding the setup of the color
> table,,,but I'm unclear on how I should set it up other than
> what I have.
>
> The callback was used to interactively change the color table, but it
> wasn't helpful.
>
> This is on Windows 7, using Visual Studio, and VTK 5.10.1
>
> Thanks
>
> Rick
>
> ----------------CODE---------------------------------------------------
>
> #include <vtkRenderer.h>
> #include <vtkRenderWindow.h>
> #include <vtkRenderWindowInteractor.h>
> #include <vtkFloatArray.h>
> #include <vtkImageMapper.h>
> #include <vtkImageData.h>
> #include <vtkPointData.h>
> #include <vtkActor2D.h>
> #include <vtkImageMapToColors.h>
> #include <vtkLookupTable.h>
> #include <vtkMinimalStandardRandomSequence.h>
> #include <vtkInteractorStyle.h>
> #include "vtkInteractorStyleImage.h"
> #include <vtkCommand.h>
>
> #include <vtkSmartPointer.h>
>
>
>
> class vtkImageInteractionCallback : public vtkCommand
> {
> public:
>
> ? ? static vtkImageInteractionCallback *New()?
> ? ? {
> ? ? ? ? return new vtkImageInteractionCallback;
> ? ? };
>
> ? ? vtkImageInteractionCallback()?
> ? ? {
>
> ? ? ? ? this->Interactor = 0;
> ? ? };
>
> ? ? void SetInteractor(vtkRenderWindowInteractor *interactor)?
> ? ? {
> ? ? ? ? this->Interactor = interactor;?
> ? ? };
> ? ? vtkRenderWindowInteractor *GetInteractor()?
> ? ? {
> ? ? ? ? return this->Interactor;
> ? ? };
>
> ? ? void SetColorTable(vtkLookupTable* colorTable)
> ? ? {
> ? ? ? ? ColorTable = colorTable;
> ? ? }
> ? ? virtual void Execute(vtkObject *, unsigned long event, void *)
> ? ? {
> ? ? ? ? vtkRenderWindowInteractor *interactor = this->GetInteractor();
>
> ? ? ? ?
> ? ? ? ? int currPos[2];
> ? ? ? ? interactor->GetEventPosition(currPos);
>
> ? ? ? ? if (event == vtkCommand::LeftButtonPressEvent)
> ? ? ? ? {
> ? ? ? ? ? ? ?clickPos[0] = currPos[0];
> ? ? ? ? ? ? ?clickPos[1] = currPos[1];
>
> ? ? ? ? }
> ? ? ? ? else if (event == vtkCommand::LeftButtonReleaseEvent)
> ? ? ? ? {
>
> ? ? ? ? }
>
> ? ? ? ? else if (event == vtkCommand::MouseWheelForwardEvent)
> ? ? ? ? {
> ? ? ? ? ? ?
> ? ? ? ? }
> ? ? ? ? else if (event == vtkCommand::MouseWheelBackwardEvent)
> ? ? ? ? {
> ? ? ? ? ? ?
> ? ? ? ? ? ??
> ? ? ? ? }
>
> ? ? ? ? else if (event == vtkCommand::MouseMoveEvent)
> ? ? ? ? {
>
> ? ? ? ? }
> ? ? ? ? else
> ? ? ? ? {
> ? ? ? ? ? ? vtkInteractorStyle *style = vtkInteractorStyle::SafeDownCast(
> ? ? ? ? ? ? ? ? interactor->GetInteractorStyle());
> ? ? ? ? ? ? if (style)
> ? ? ? ? ? ? {
> ? ? ? ? ? ? ? ? style->OnMouseMove();
> ? ? ? ? ? ? }
> ? ? ? ? }
> ? ? }
>
> ? ? vtkRenderWindowInteractor *Interactor;
> ? ? vtkLookupTable * ColorTable;
> ? ? int clickPos[2];
> };
>
>
>
> int main (int argc, char *argv[])
> {
>
>
> ? ? vtkSmartPointer<vtkRenderer> aRenderer =
> ? ? ? ? vtkSmartPointer<vtkRenderer>::New();
> ? ? vtkSmartPointer<vtkRenderWindow> renWin =
> ? ? ? ? vtkSmartPointer<vtkRenderWindow>::New();
> ? ? renWin->AddRenderer(aRenderer);
>
> ? ? vtkSmartPointer<vtkRenderWindowInteractor> iren =
> ? ? ? ? vtkSmartPointer<vtkRenderWindowInteractor>::New();
> ? ? iren->SetRenderWindow(renWin);
>
>
>
> ? ? vtkSmartPointer<vtkFloatArray> floatData =
> vtkSmartPointer<vtkFloatArray>::New();
>
> ? ? vtkIdType width = 500;
> ? ? vtkIdType height = 500;
>
>
>
> ? ? vtkIdType nt = width * height;
> ? ? floatData->SetNumberOfTuples(nt);
> ? ? vtkSmartPointer<vtkMinimalStandardRandomSequence> rg =
> vtkSmartPointer<vtkMinimalStandardRandomSequence>::New();
>
> ? ? for(vtkIdType i = 0; i < nt; i++)
> ? ? {
> ? ? ? ? float rn = rg->GetRangeValue(0,0.69);
> ? ? ? ? rg->Next();
> ? ? ? ?
> ? ? ? ? floatData->SetTuple(i,&rn);
> ? ? }
>
> ? ? vtkSmartPointer<vtkImageData> image =
> vtkSmartPointer<vtkImageData>::New();
> ? ? image->SetExtent(0,width-1,0,height-1,0,0);
> ? ? image->SetNumberOfScalarComponents(1);
> ? ? image->SetScalarTypeToFloat();
> ? ? image->SetSpacing(0.1,0.1,1.0);
>
> ? ? image->GetPointData()->SetScalars(floatData);
>
> ? ? vtkSmartPointer<vtkImageMapper> mapper =
> ?vtkSmartPointer<vtkImageMapper>::New();
>
> ? ? mapper->SetInputConnection(image->GetProducerPort());
> ? ? mapper->SetColorWindow(1.0);
> ? ? mapper->SetColorLevel(0.5);
>
> ? ? vtkSmartPointer<vtkActor2D> actor = vtkSmartPointer<vtkActor2D>::New();
> ? ? actor->SetPosition(0,0);
>
> ? ? actor->SetMapper(mapper);
>
> ? ? aRenderer->AddActor(actor);
>
> ? ? // turn this on to map to colors.
> #if 0
> ? ? vtkSmartPointer<vtkImageInteractionCallback> callback =
> vtkSmartPointer<vtkImageInteractionCallback>::New();
> ? ? vtkSmartPointer<vtkInteractorStyleImage> imageStyle =
> vtkSmartPointer<vtkInteractorStyleImage>::New();
> ? ??
> ? ? iren->SetInteractorStyle(imageStyle);
> ? ? callback->SetInteractor(iren);
> ? ? renWin->SetInteractor(iren);
> ? ? imageStyle->AddObserver(vtkCommand::MouseMoveEvent, callback);
> ? ? imageStyle->AddObserver(vtkCommand::LeftButtonPressEvent, callback);
> ? ? imageStyle->AddObserver(vtkCommand::LeftButtonReleaseEvent, callback);
> ? ? ?imageStyle->AddObserver(vtkCommand::MouseWheelForwardEvent, callback);
>
> ? ? imageStyle->AddObserver(vtkCommand::MouseWheelBackwardEvent, callback);
> ? ? vtkSmartPointer<vtkImageMapToColors> filter =
> vtkSmartPointer<vtkImageMapToColors>::New();
> ? ? vtkSmartPointer<vtkLookupTable> colorTable =
> vtkSmartPointer<vtkLookupTable>::New();
> ? ? callback->SetColorTable(colorTable);
> ? ? filter->SetOutputFormatToRGBA();
> ? ? colorTable->SetTableRange(0,1);?
>
>
> ? ? colorTable->SetHueRange(0.3,0.3);
> ? ? colorTable->SetSaturationRange(0,1);
> ? ? colorTable->SetValueRange(1,1);
> ? ? colorTable->SetRampToLinear();
> ? ? colorTable->ForceBuild();
> ? ? filter->SetLookupTable(colorTable);
> ? ? filter->SetNumberOfThreads(1);
>
> ? ? filter->SetInputConnection(image->GetProducerPort());
> ? ? mapper->SetInputConnection(filter->GetOutputPort());
> #endif
>
>
> ? ? aRenderer->SetBackground(.2, .3, .4);
> ? ? renWin->SetSize(640, 480);
>
>
>
> ? ? // Initialize the event loop and then start it.
> ? ? iren->Initialize();
> ? ? iren->Start();
>
> ? ? return EXIT_SUCCESS;
> }
>
>
> On Jul 19, 2013, at 09:32 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>
> Can you post a small, compilable example that illustrates the problem?
>
>
>
> On Fri, Jul 19, 2013 at 9:20 PM, Rick Frank <rickfrank at me.com> wrote:
>
> Hi,
>
> I'm getting some behavior I don't understand when trying to map gray
> floating point image to a color image
>
> What I'm seeing is that the output is completely white.
>
> my code is roughly as follows
>
> filter->SetOutputFormatToRGBA()
>
> colorTable->SetTableRange(0,1)
> colorTable->SetHueRange(0,1);
> colorTable->SetSaturationRange(0,1);
> colorTable->SetValueRange(0,1);
> colorTable->SetRampToLinear();
>
> colorTable->ForceBuild();
>
> Now, when I trace through the code, the values set in the RGBA image look
> correct. But the ultimate rendered image is completely white.
>
> If I modify the code so that all the RGBA values are 1,0,0,255 the image
> is solid red. If I change the alpha to 64 nothing changes.
>
> So, I suspect it's the mapper - I use the same mapper - vtkImageMapper to
> display the color image by resetting the input connection:
>
> mapper->SetInputConnection(filter->GetOutputPort());
> imageActor->SetMapper(mapper);
>
> Do I need to make a change to the mapper to get the proper RGBA display?
>
>
> Thanks
>
> Rick
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130720/c6f05073/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 9
> Date: Sat, 20 Jul 2013 15:54:48 -0400
> From: Vachik Dave <vsdave at umail.iu.edu>
> Subject: Re: [vtkusers] Problem in Read Dicom Series
> To: David Gobbi <david.gobbi at gmail.com>, vtkusers at vtk.org
> Message-ID:
> <CADB4r1kG67d7iq1xzYf3hzDE=
> CFzzxPNHWo6dCHQFdHfiFJYPQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Ohk, thank you very much for your help.
>
>
> Regards*.
> --Vachik Dave*
>
>
> On Sat, Jul 20, 2013 at 3:49 PM, David Gobbi <david.gobbi at gmail.com>
> wrote:
>
> > Hi Vachik,
> >
> > Please don't email off-list. Keep the discussion on the mailing list
> > so that all users can benefit from it.
> >
> > If you need to load multiple files, then use SetFileNames() to give
> > the tiff reader a list of filenames in a vtkStringArray. You can
> > either build the list of filenames in a for() loop, or you can use
> > vtkGlobFileNames to build the list with a wildcard like "*.tif".
> >
> > - David
> >
> > On Sat, Jul 20, 2013 at 1:21 PM, Vachik Dave <vsdave at umail.iu.edu>
> wrote:
> > > Well, I need to read 99 slices and then pass that to Marching cube code
> > to
> > > generate 3D image.
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130720/2e3ce9e5/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 10
> Date: Sun, 21 Jul 2013 00:19:02 +0200
> From: Marco Sambin <m.sambin at gmail.com>
> Subject: Re: [vtkusers] Problem in Read Dicom Series
> To: vtkusers at vtk.org
> Message-ID:
> <CAFoCWhun_EPNmDMOp-5DHp4zeqiq=
> e17J5kSJvcjrf-5Qwb2-Q at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Vachik,
>
> David certainly provided a goog suggestion, as always.
> You will still need to know at least your data spacing in order to generate
> a volume.
> Do you know this info for your source Tiff dataset?
>
> Regards,
>
> Marco
> Il giorno 20/lug/2013 21:54, "Vachik Dave" <vsdave at umail.iu.edu> ha
> scritto:
>
> > Ohk, thank you very much for your help.
> >
> >
> > Regards*.
> > --Vachik Dave*
> >
> >
> > On Sat, Jul 20, 2013 at 3:49 PM, David Gobbi <david.gobbi at gmail.com
> >wrote:
> >
> >> Hi Vachik,
> >>
> >> Please don't email off-list. Keep the discussion on the mailing list
> >> so that all users can benefit from it.
> >>
> >> If you need to load multiple files, then use SetFileNames() to give
> >> the tiff reader a list of filenames in a vtkStringArray. You can
> >> either build the list of filenames in a for() loop, or you can use
> >> vtkGlobFileNames to build the list with a wildcard like "*.tif".
> >>
> >> - David
> >>
> >> On Sat, Jul 20, 2013 at 1:21 PM, Vachik Dave <vsdave at umail.iu.edu>
> wrote:
> >> > Well, I need to read 99 slices and then pass that to Marching cube
> code
> >> to
> >> > generate 3D image.
> >>
> >
> >
> > _______________________________________________
> > 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
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130721/2ce296c8/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 11
> Date: Sun, 21 Jul 2013 11:08:11 +0300
> From: max perlman <smapersmaper at gmail.com>
> Subject: [vtkusers] smapersmaper
> To: mali_almasi at walla.co.il, jobs at ips.co.il, geula at korentec.co.il,
> vtkusers at vtk.org, info at biolink.co.il, hila at unilink.co.il,
> ella.tchaikov at gmail.com, t2chris at gmail.com, jobs at mercury.co.il
> Message-ID:
> <
> CA+UYaUqGuK-H65L810PVyJVC5R9dU41qif8K6M-ZZNMGE6G6Fg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> http://craveyourgoals.com/rzompq/lvjz.fdbsd
>
>
>
>
>
> smapersmaper
>
>
> 7/21/2013 9:08:04 AM
>
>
> ------------------------------
>
> Message: 12
> Date: Sun, 21 Jul 2013 10:56:59 +0200
> From: Agata Kraso? <agatakrason at gmail.com>
> Subject: [vtkusers] Agata Krason
> To: ebro at biznespoczta.pl, f.kintz at wanadoo.fr, agatakrason at gmsil.com,
> grandlarge at franceloc.fr, vtkusers at vtk.org,
> infos at campinglesdunes.fr,
> contact at uronea.com, contact at campinglesdunes.fr,
> Danuta.Stasiowkska at polsl.pl
> Message-ID:
> <
> CAKKYitNz1H77w+18NPy9q+JYtOqpFDidDEEbDu3ybN5JKKNtsg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> http://hubobeveren.be/int/xayy.ppdjxjlfccioksfwi
>
>
>
>
>
> Agata Krason
>
>
> 7/21/2013 9:56:48 AM
>
>
> ------------------------------
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest, Vol 111, Issue 35
> *****************************************
>
--
*Best Regards
Rahul Indoria
Mobile No: +49-157-35652212*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130722/2a790932/attachment.htm>
More information about the vtkusers
mailing list