Algorithm@Volume Rendering

Volume Rendering(體繪製)有3種的演算法: RayCast: 圖像空間,雖慢但是很準確的繪制方式。 Splatting: 物體空間 ShearWarp: 結合上述2種方法的優點。

 

Misc Stream

vtkStreamingDemandDrivenPipeline

Executive supporting partial updates.

vtkStreamingDemandDrivenPipeline is an executive that supports updating only a portion of the dataset in the pipeline. This is the style of pipeline update that is provided by the old-style VTK 4.x pipeline. Instead of always updating an entire dataset, this executive supports asking for pieces or sub-extents.

範例:
vtkStreamingDemandDrivenPipeline *exec=
vtkStreamingDemandDrivenPipeline::SafeDownCast(elev->GetExecutive());
        exec->SetUpdateNumberOfPieces(exec->GetOutputInformation(0), numProcs);
        exec->SetUpdatePiece(exec->GetOutputInformation(0), myid);
APIs:
int  PropagateUpdateExtent(int outputPort)
int  SetUpdateExtentToWholeExtent(vtkInformation *)
virtual int  ProcessRequest(vtkInformation *request, 
vtkInformationVector **inInfo, vtkInformationVector *outInfo)
virtual int  Update()
virtual int  Update(int port)
virtual int  UpdateWholeExtent()
int  SetMaximumNumberOfPieces(vtkInformation *, int n)
int  GetMaximumNumberOfPieces(vtkInformation *)
int  SetWholeExtent(vtkInformation *, int extent[6])
void  GetWholeExtent(vtkInformation *, int extent[6])
int *GetWholeExtent(vtkInformation *)
int  SetUpdateExtent(vtkInformation *, int extent[6])
void  GetUpdateExtent(vtkInformation *, int extent[6])
int *GetUpdateExtent(vtkInformation *)
int  SetUpdateExtent(vtkInformation *, int piece,
int numPieces, int ghostLevel)
int  SetUpdatePiece(vtkInformation *, int piece)
int  GetUpdatePiece(vtkInformation *)
int  SetUpdateNumberOfPieces(vtkInformation *, int n)
int  GetUpdateNumberOfPieces(vtkInformation *)
int  SetUpdateGhostLevel(vtkInformation *, int n)
int  GetUpdateGhostLevel(vtkInformation *)
int  SetRequestExactExtent(int port, int flag)
int  GetRequestExactExtent(int port)
int  SetExtentTranslator(vtkInformation *,
vtkExtentTranslator *translator)
vtkExtentTranslator *GetExtentTranslator(vtkInformation *info)
int  SetWholeBoundingBox(int port, double bb[6])
void  GetWholeBoundingBox(int port, double bb[6])
double *GetWholeBoundingBox(int port)

 

Misc Filters

vtkElevationFilter

generate scalars along a specified direction.

vtkElevationFilter is a filter to generate scalar values from a dataset. The scalar values lie within a user specified range, and are generated by computing a projection of each dataset point onto a line. The line can be oriented arbitrarily. A typical example is to generate scalars based on elevation or height above a plane.

vtkElevationFilter範例:

vtkElevationFilter *elev = vtkElevationFilter::New();
        elev->SetInput( shrink->GetOutput() );
        elev->SetLowPoint(-1,-1,-1);
        elev->SetHighPoint( 1, 1, 1);
        elev->SetScalarRange(0,1);
或是在ParallelIso之中的例子
vtkElevationFilter *elev=vtkElevationFilter::New();
        elev->SetInput(iso->GetOutput());
        val = (myid+1) / static_cast(numProcs);
        elev->SetScalarRange(val, val+0.001);

APIs:


 

vtkMarchingCube@Isosurface

vtkMarchingCube是繪製出Isosurface的方法。

Human Femur

I built a femur by this pipeline: vtkVolume16Reader->vtkImageGaussianSmooth->vtkMarchingCubes-> vtkDecimate->vtkSTLWriter Once I build the isosurface, then I use vtkCutter to generate several spaced contours, then save this contours to a DXF file. now this dxf file contains sever layer contours, but i am not famillar with CAD programs, if it is possible to generate a solid model based on these contour layers?

 

vtkMPI Misc API

Daniel所寫

平行程式會面對的課題: I mean the ray cast functions, composite and MIP, as well as the existing isosurface implementation.

要使用vtk作到平行化的應用程式,需要用到vtkMultiProcessController, vtkMPIController。

Parallel Pipeline:

  1. Initialize():
  2. The use of user-defined communicators are supported with vtkMPICommunicator and vtkMPIGroup.
  3. SetSingleMethod()
  4. SingleMethodExecute()
  5. Finalize():

作者為Geveci, Berk

API@vtkMPIController列表:

virtual void  Initialize(int *argc, char ***argv)
virtual void  Finalize()
virtual void  SingleMethodExecute()
virtual void  MultipleMethodExecute()
void Barrier()
virtual void  CreateOutputWindow()
void  SetCommunicator(vtkMPICommunicator *comm)
int  NoBlockSend(int *data, int length, int remoteProcessId,
 int tag, vtkMPICommunicator::Request &req)
Hi, 
        I am doing some research on medical visualization and real time volume  
rendering. About display the reconstruction result, there are  many system and algorithm 
.  
        About reconstruction, I think the segmentation is key problem. Many company  
or reseacrh unit use human expert to complish this task. In this area, some image 
processing technique can be used but interaction by people is hardly avoid. 
        About rendering the reconstruction result or segmentation result, it is 
a hot point in computer graphics. (that is what I do now). Two famous software 
(free) is VTK and VolVis. These two system can be extend by yourself. I think it can 
be satisfy your demand for display.  
        The problem for display 3D model od resconstrction is the data is too large 
, so that it must be handled for several minutes and occupy a lot of memory. Extract 
isosurface or disply volume data directlyare two methods fro display it. Both are slow 
but the former is faster than later. 
        For visualization, the IEEE Visualization proceeding is a good collection 
. Many new technique can be found in it. The 90, 91,92,93,94 can be found in tsinghua 
library in microphoto format. Another publish collection is Visualization on 
Biomedical computing proceeding and SPIE medical imaging series.  
        I expect we can discuss and study together or same interests by email. 
        BTW, there are Vis FAQ in Ohio university web site. I will post the address 
here ASAP. 

 

Vtk Pipelines

使用Vtk函式庫的Pipelines,簡略整理成如下的流程,簡稱為DPM-AV-RIW:
  1. 讀入Datasets: 使用vtkImageReader, vtkDICOMImageReader...各類不同的Reader,將資料讀入,然後讀轉出成Geometry資訊。
  2. 設定屬性(Property): 使用vtkVolumeProperty作出VolProperty物件,再使用vtkPiecewiseFunction, vtkColorTransferFunction設定VolProperty的不透明度、顏色...的屬性,然後藉由SetScalarOpacity(Piecewise), SetColor(Color), SetInterpolationTypeToLinear(), ShadeOn(),來設定VolProperty的屬性。
  3. 設定幾何資訊(Mapper): 利用vtkVolumeRayCastMapper, vtkFixedPointVolumeRayCastMapper作出VolMapper物件。
  4. Actor2D, Actor, vtkVolume
  5. vtkRenderer
  6. RenderWindow
  7. RenderWindowInteractor, InteractorStyle

 

vtkDICOMImageReader API

所有的Member Functions列表:

void    PrintSelf(ostream &os, vtkIndent indent)
void    SetDirectoryName(const char *dn)
double *GetPixelSpacing()
int     GetWidth()
int     GetHeight()
float *GetImagePositionPatient()
int     GetBitsAllocated()
int     GetPixelRepresentation()
int     GetNumberOfComponents()
const char *GetTransferSyntaxUID()
float   GetRescaleSlope()
float   GetRescaleOffset()
const char *GetPatientName()
const char *GetStudyUID()
const char *GetStudyID()
float   GetGantryAngle()
virtual int CanReadFile(const char *fname)
void    SetFileName(const char *fn)
virtual char *GetDirectoryName()

 

Pipelines@Volume Rendering

vtkImageData

topologically and geometrically regular array of data

vtkImageData is a data object that is a concrete implementation of vtkDataSet. vtkImageData represents a geometric structure that is a topological and geometrical regular array of points. Examples include volumes (voxel data) and pixmaps.


vtkFixedPointVolumeRayCastCompositeHelper -- A helper that generates composite images for the volume ray cast mapper. It will generate composite images using an alpha blending operation.

vtkFixedPointVolumeRayCastCompositeGOHelper -- A helper that generates composite images for the volume ray cast mapper.

想要使用VTK,作出Volume Render的應用程式(最終還是要作出Parallel化的版本),其間的Pipeline應為:

  1. 讀資料: 使用vtkImageReader類別,作出 ImgReader物件,然後使用SetFileName, SetDataScalarTypeToFloat, SetDataByteOrderToBigEndian, SetFileDimensionality, SetDataExtent, SetDataSpacing, SetHeaderSize..., 最後再用 Update來讀入這些圖形檔案(png, jpeg, dicom...)、或是raw-data(.vtk)的資訊。
  2. 設定VolRndr物件的Property: 使用vtkVolumeProperty作出VolProperty物件,然後使用
    VolProperty->SetScalarOpacity(opacity);
    VolProperty->SetColor(color);
    呼叫,加入Color、或是Piecewise的屬性。
  3. Piecewise屬性: 使用vtkPiecewiseFunction作出Opacity物件,然後使用
    Opacity->AddPoint(500, 0.1)
    呼叫,加入各點不透明度的資訊。
  4. Color屬性: 使用vtkColorTransferFunction作出Color物件,然後使用
    Color->AddRGBPoint(0, 0.3, 0.3, 1.0)
    呼叫,加入RGB顏色的資訊。
  5. 融合屬性: 使用vtkVolumeRayCastCompositeFunction作出compositeFun物件,目的是為了融合之前所作出Color屬性或是Piecewise屬性。
  6. 產生Geometry資訊: 使用vtkVolumeRayCastMapper,或是vtkFixedPointVolumeRayCastMapper作出VolMapper物件,兩者的區別,請看以下的說明:
    VolMapper->SetVolumeRayCastFunction(Composite); //將Color、Piecewise的屬性,融合於VolProperty物件。
    VolMapper->SetInput(ImgReader->GetOutput()); //將ImgReader讀入的Datasets轉成Geometry資訊。
  7. 使用vtkVolume作出VolRndr:
    VolRndr->SetMapper(VolMapper); //加入VolMapper的幾何資訊
    VolRndr->SetProperty(VolProperty); //加入VolProperty的顏色、Piecewise屬性。
  8. 使用vtkRenderer作出Rndr物件:
    Rndr->AddVolume(VolRndr); //在記憶體中繪製VolRndr物件
    Rndr->SetBackground(1., 1., 1.); //設定Rndr物件的屬性
  9. 使用vtkRenderWindow作出繪製視窗RndrWin物件:
    RndrWin->AddRenderer(Rndr); //繪製視窗加入render物件
    RndrWin->SetSize(500,500); //設定視窗大小屬性
    RndrWin->SetInteractor(InterRen); //也可以加入繒製互動式視窗物件InterRen
  10. 使用vtkRenderWindowInteractor作出繪製互動視窗InterRen
    RndrWin->Render(); //開始繪製
    InterRen->Start(); //開始互動式視窗

vtkVolumeRayCastMapper vs. vtkFixedPointVolumeRayCastMapper

vtkVolumeRayCastMapper可以用來作isosurface,而處理的資料型態為unsigned char或是unsigned short。 vtkFixedPointVolumeRayCastMapper的資料型態為short或是more than one component,處理的範圍為unsigned char到double。

Features of vtkFixedPointVolumeRayCastMapper

Space leaping is performed by creating a sub-sampled volume. 4x4x4 cells in the original volume are represented by a min, max, and combined gradient and flag value. The min max volume has three unsigned shorts per 4x4x4 group of cells from the original volume - one reprenting the minumum scalar index (the scalar value adjusted to fit in the 15 bit range), the maximum scalar index, and a third unsigned short which is both the maximum gradient opacity in the neighborhood (an unsigned char) and the flag that is filled in for the current lookup tables to indicate whether this region can be skipped.


 

Medical ITK

專針對醫學影像格式用的圖形函式庫MITK(Medical Image Toolkit)。

cvs snapshot

cvs -d :pserver:anonymous@mbi.dkfz-heidelberg.de:/usr/local/cvsroot login
cvs -d :pserver:anonymous@mbi.dkfz-heidelberg.de:/usr/local/cvsroot co mitk

安裝方式和VTK一樣,但要ITK要先安裝起來

mkdir MitkBuild
cd Mitkbuild
ccmake ../mitk

但安裝前要先安裝ITK(Insight Segmentation and Registration Toolkit)

cvs -d :pserver:anoncvs@www.itk.org:/cvsroot/Insight login(empty password)
cvs -d :pserver:anoncvs@www.itk.org:/cvsroot/Insight co Insight
cvs -d :pserver:anoncvs@www.itk.org:/cvsroot/Insight co InsightDocuments
cvs -d :pserver:anoncvs@www.itk.org:/cvsroot/Insight co InsightApplications

 

Parallel Rendering@學術機構

  • cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/osirix co plugins
  • VolRender@Mac
  • Daniel參與的計劃
  • Osirix Mailing list
  • 在google鍵入關鍵字
    parallel volume render "paraview" site:public.kitware.com
    ,會有比較好的搜尋結果出現。

    平行運算

    關於Viz的論文

    朱濤

    打入"vtk parallel volume render Los Alamos",google就找出了學術搜索的文件ParallelApproach4EfficientlyVisualizing.pdf,在Los Alamos與Argonne學術領域的機構,對於"Visulization Large-Scale Time-varing Scientific Datasets"的需求是一致的。

    可以聯絡的作者有:
    C. Charles Law, Amy Henderson --  Kitware Incorporated
    James Ahrens -- Los Alamos National Laboratory
    Standford大學有開發關於volume rendering的技術。
    1. Shading Language
    2. VolPack

     

    Free Virtual Reality

    http://mecca.louisville.edu/Staff/Sites/vtkFVR.html
    http://mecca.louisville.edu/Staff/Sites/vtkfvr.tar.gz
    http://www.freevr.org
    http://www.cvip.uofl.edu/~chuck
    

     

    Triangles from 3D-Points

    vtkPolyDataReader reader
      reader SetFileName "../vtkData/assignment1.vtk"
      reader Update
    vtkPolyData data
       data SetPoints [[reader GetOutput] GetPoints]
    
    vtkDelaunay3D del
        del SetInput data
        del BoundingTriangulationOn
        del SetTolerance 0.01
        del SetAlpha 0.2
        del BoundingTriangulationOff
    
    vtkShrinkFilter shrink
        shrink SetInput [del GetOutput]
        shrink SetShrinkFactor 0.9
    
     vtkElevationFilter elevation
        elevation SetInput [shrink GetOutput]
        elevation SetLowPoint 0 0 0
        elevation SetHighPoint 0 0 1
       eval elevation SetScalarRange 0 1
        elevation ReleaseDataFlagOn
    
    vtkWarpScalar warp
      warp SetInput [elevation GetOutput]
      warp SetScaleFactor -0.1

     

    vtkParallel Tests

    Volume rendering of data stored in unstructured grid可使用vtkUnstructuredGridVolumeMapper來處理,可看範例程式 -- classvtkUnstructuredGridVolumeMapper。

    vtkParallelCoordinatesActor
    
        * Tcl - /Rendering/Testing/Tcl/TestParallelCoordinates.tcl 
    
    vtkParallelFactory
    
        * C++
     - /Parallel/Testing/Cxx/GenericCommunicator.cxx
     - /Parallel/Testing/Cxx/MPIGroups.cxx
     - /Parallel/Testing/Cxx/ParallelIso.cxx
     - /Parallel/Testing/Cxx/TestPStream.cxx
     - /Parallel/Testing/Cxx/ThreadedCommunicator.cxx
        * Tcl - /Common/Testing/Tcl/TestSetGet.tcl
     - /Parallel/Testing/Tcl/TestPolyDataPieces.tcl
     - /Parallel/Testing/Tcl/TestUnstructuredPieces.tcl 
    
    vtkParallelRenderManager
    
        * C++ - /Parallel/Testing/Cxx/PrmMagnify.cxx 

     

    Jobs Vacaumn

    https://hrntserver1.lanl.gov/JPS/SingleJobAd.asp? ReqNumber=016348&ReqScope=INTERNAL%2FEXTERNAL& ReqTitle=STAFF%2BMEMBER&JobType=UC&JobReopened=N Job# 016348 STAFF MEMBER - COMPUTER SCIENCE Organization: CCS-1 Date Posted: 10/17/2002 Series/Level: TSM Status: CLOSED Appointment Type: Regular Number of Openings: 2 Employment Type: UC Recruiting Scope: Clearance: Q (Position will be cleared to this level). Applicants selected will be subject to a Federal background investigation and must meet eligibility requirements for access to classified matter. Summary: The Advanced Computing Group in the Computer and Computational Sciences (CCS) Division is looking for a visualization scientist. Principal duties include research and development of high performance parallel and distributed visualization algorithms and tools, working with users to assist in their visualization needs, and interfacing with other scientists associated with CCS Division. CCS-1 serves as a focal point for Lab research in advanced computing, providing technologically advanced facilities in parallel computation, high-speed networking and scientific visualization. It fosters an environment that encourages applications-driven, interdisciplinary work in computer science, engineering, applied mathematics, and other sciences; and serves as an interface to the computational science community outside Los Alamos. Required Skills: Recent technical leadership within software research and development projects. Extensive working experience with parallel and distributed visualization software and hardware. Experience in two or more of the following: UNIX, OpenGL, DirectX, C++, C or software frameworks. Demonstrated experience adapting to changing priorities. Effective written and oral communication skills. Experience working in a team-oriented technical atmosphere. Ability to obtain a DOE Q clearance which normally requires U.S. citizenship. Desired Skills: Significant experience with SGI or PC graphics hardware and software. Demonstrated publishing and conference participation experience. Experience with visualization packages such as IBM Data Explorer, CEI EnSight, and the Visualization Toolkit (VTK). Experience with cross platform development on SGI, Sun, Compaq, IBM SP2 and Windows NT/2000. Experience with PC cluster-based rendering and visualization. Experience with MPI or PVM. Active Q-clearance. Education: Ph.D. in computer science or equivalent combination of relevant education and experience is required. Contact: For specific questions about the status of this job, call (505) 667-2361.

     

    Parallel Rendering Projects

    http://www.ccs.lanl.gov/ccs1/projects/Viz/pr-vtk.html Parallel visualization algorithms can simultaneously support handling much larger data sets than sequential counterparts, and improve interactivity. Distributed and distance algorithms address local area and wide area visualization. While both kinds of algorithms have similarities, "visualization at a distance" greatly affects the range of solutions. The ACL Visualization Team has been instrumental in the organization of the IEEE/ACM Parallel Rendering Symposium, the IEEE/ACM Parallel Visualization and Graphics Symposium, and the Eurographics Workshop on Parallel Graphics and Visualization. We have developed and published new parallel algorithms for software-based volume rendering, polygon rendering, image compositing, multiresolution wavelet encoding, and isosurface extraction.

     

    Parallel Rendering@VTK

    http://www.cs.unm.edu/~kmorel/documents/vtk_c2w/vtk_c2w.pdf

    This page is powered by Blogger. Isn't yours?