본문 바로가기

3D Visualization

K3D Jupyter

VTK Library를 활용해 C++에서 프로그램을 개발하는데 너무 많은 시간이 걸릴것 같아, 잠시 Python으로 구현된 K3D를 먼저 연구하는것으로 방향을 틀었다. 거의 3주 동안에 Library 설치하는것에만 시간을 들였는데..결국 완전하게 설치되지 못했다.

 

일단 3D Data를 시각화하는 것이 이번 연구의 목적이다. VTK라는 Lib를 기반으로 많은 응용 SW가 만들어지고 있는것으로 짐작된다...

Python으로 구현된 VTK API를 Study하면서 차근차근 접근해보자.

 

가상환경 Anaconda에 K3D 환경을 추가하고 Git hub에서 소스를 다운받는다.

https://github.com/K3D-tools/K3D-jupyter

 

K3D-tools/K3D-jupyter

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is...

github.com

이렇게 설치하고 예제들을 실행해 본다.

camera_manipulation
Molecular_Dynamics_visualization-demo

Tutorial Gallery에 가면 많은 예제들을 경험할수 있다.

https://k3d-jupyter.org/showcase/index.html

 

Gallery — K3D-jupyter 2.7.3 documentation

© Copyright 2020 Marcin Kostur, Artur Trzęsiok, Tomasz Gandor, Filip Kaśkosz.

k3d-jupyter.org

심장 CT data를 한번 돌려보고 싶었으나,...Point Cloud dataset를 활용해 한번 실행해 본다.

jupyter notebook 실행에서 Pyunpack, patool을 추가로 설치했다.

 

 

  • pip install pyunpack
  • pip install pyunpack

http://www.semantic3d.net/view_dbase.php?chl=1

 

Semantic3D - Data

semantic-8 is a benchmark for classification with 8 class labels, namely {1: man-made terrain, 2: natural terrain, 3: high vegetation, 4: low vegetation, 5: buildings, 6: hard scape, 7: scanning artefacts, 8: cars}. An additional label {0: unlabeled points

www.semantic3d.net

 

dataset을 다운받아 한번 실행해 봤다. 실행하는데 약 3-4분정도 소요가 된다.

압축을 풀고 파일 경로를 바로 지정했다. 

  • filename = './examples/castleblatten_station1_intensity_rgb.txt'

 

 

예제중에 'volume_renderer'는 VTK 라이브러리를 Import하는 예제다.

설치를 추가로 진행했다.

  • conda install -c conda-forge vtk

anaconda.org/conda-forge/vtk

 

참고) github.com/marcomusy/vtkplotter

 

Data를 다운로드 중에 에러가 발생해 직접다운로드 한다. 코드 수정후에 실행.

 

 

오랜만에 프로그램 실행하면서 사용법익히면서 시간을 보냈다.

'3D Visualization' 카테고리의 다른 글

3D Scan  (0) 2020.08.22
scikit-image  (0) 2020.05.16
VTK Plotter  (0) 2020.05.16
3D Slicer  (0) 2020.05.16
OPEN 3D  (0) 2020.05.16