[vtkusers] vtkVolume16Reader

Nicolas DUMONT s991848 at student.ulg.ac.be
Thu Mar 18 06:13:02 EST 2004


Hello !! I have the same problem. I'm trying to read
'brainweb1e1a10f20.raw'. I guess you are talking about the same dataset
(which can be found on ftp://public.kitware.com/pub/itk/Data/BrainWeb or
http://www.bic.mni.mcgill.ca/brainweb). But This is MR PD (proton density
weighted) modality and not CT. (?)

BrainWeb download: PD ICBM normal 1mm pn3 rf20
Modality=PD, Protocol=ICBM, Phantom_name=normal, Slice_thickness=1mm,
Noise=3%, INU=20%
MINC volume info:
image: signed__ short 0 to 4095
image dimensions: zspace yspace xspace
    dimension name         length         step        start
    --------------         ------         ----        -----
    zspace                    181            1          -72
    yspace                    217            1         -126
    xspace                    181            1          -90
Original MINC file size: 10.5 Mb

I have some questions about your code.... (see above) ... hope someone can
help!!!!

Nicolas DUMONT
Ulg, BELGIUM.



----- Original Message -----
From: "LIAM JAMES ATKINS" <99087138 at luton.ac.uk>
To: <vtkusers at vtk.org>; <vtkusers at vtk.org>
Sent: Wednesday, March 10, 2004 10:22 PM
Subject: [vtkusers] vtkVolume16Reader


i am having trouble with displaying a ct scan using the vtkVolume16Reader i
have transported it from dicom format to raw format but it just shows a very
faint outline of the scan it vaguely looks like it should and appears 4
times. i gather the reason for it appearing 4 times is because it is an 8
bit raw file.

so i need help on why im am not getting a decent image up and how to change
it from an 8 bit file to a 16 bit file can any one help??

the code is:

#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkProperty.h"
#include "vtkCamera.h"
#include "vtkContourFilter.h"
#include "vtkVolume16Reader.h"
#include "vtkPolyDataNormals.h"


int main (int argc, char **argv)
{



vtkRenderer *aRenderer = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
    renWin->AddRenderer(aRenderer);
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);

vtkVolume16Reader *v16 = vtkVolume16Reader::New();   // is vtk
volume16reader really what we need? shouldnt we use vtkvolumereader or
vtkimagereader??
        v16->SetDataDimensions(217,181);
        v16->SetImageRange (1,2000);                                  //
v16->SetImageRange (1,217) ?????
        v16->SetDataByteOrderToLittleEndian();
        v16->SetFilePrefix("brainweb1e1a10f20");
        v16->SetFilePattern("brainweb1e1a10f20.raw");
        v16->SetDataSpacing (72, 126, 90);
//why... ???
        v16->Update();

 vtkContourFilter *skinExtractors = vtkContourFilter::New();
    skinExtractors->SetInput((vtkDataSet *) v16->GetOutput());
    skinExtractors->SetValue(0, 500);
  vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
    skinNormals->SetInput(skinExtractors->GetOutput());
    skinNormals->SetFeatureAngle(60.0);
  vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();
    skinMapper->SetInput(skinNormals->GetOutput());
    skinMapper->ScalarVisibilityOff();
  vtkActor *skin = vtkActor::New();
    skin->SetMapper(skinMapper);

  aRenderer->AddActor(skin);
  aRenderer->SetActiveCamera(aCamera);
  aRenderer->ResetCamera ();
  aCamera->Dolly(1.5); // aCamera  = variable not instantiated


  aRenderer->SetBackground(1,1,1);
  renWin->SetSize(640, 480);


  aRenderer->ResetCameraClippingRange ();

  iren->Initialize();
  iren->Start();


  v16->Delete();
  skinExtractors->Delete();
  skinNormals->Delete();
  skinMapper->Delete();
  skin->Delete();
  aCamera->Delete();
  iren->Delete();
  renWin->Delete();
  aRenderer->Delete();

  return 0;
}


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list