dusunax / dicom-and-three-js-viewer

๐Ÿฉป great viewer for dcm & ply file
3 stars 0 forks source link

230610 - ThreeJS Viewer [kor] #6

Closed dusunax closed 1 year ago

dusunax commented 1 year ago

230610 - ThreeJS Viewer

2. Render 3D file

Task Description Status
A. Render 3D file (1st phase) convert DICOM file to ply file by outside of the code. Skiped (230611)
ย  (2st phase) render ply file, using threeJS. Completed (230610)
  1. ๋ ˆํผ๋Ÿฐ์Šค ์„œ์น˜_230608 : ์˜จ๋ผ์ธ ํŒŒ์ผ ๋ณ€ํ™˜ (x), ๋ทฐ์–ด ํ”„๋กœ๊ทธ๋žจ์„ ์‚ฌ์šฉํ•ด plyํฌ๋งท์œผ๋กœ export (x)
  2. converter ๊ตฌํ˜„ ์‹œ๋„_230609 : dicom parser, vtk.js (x)

A-2. ply ํŒŒ์ผ์„ ๋žœ๋”๋ง

  1. ํŒŒ์ผ์„ ๋žœ๋”๋ง_230610: three.js๋ฅผ ์‚ฌ์šฉํ•ด ply ํฌ๋งท์˜ ํŒŒ์ผ ๋žœ๋”๋ง (o)

(์ถ”๊ฐ€ ๋ชฉํ‘œ)

A-1. dcm ํŒŒ์ผ์„ ply๋กœ ๋ณ€ํ™˜

๋ ˆํผ๋Ÿฐ์Šค ์„œ์น˜_ 230608 (๋ณ€ํ™˜ ์‹คํŒจ)

  1. ์—ฌ๋Ÿฌ ์˜จ๋ผ์ธ ํŒŒ์ผ convert ์‚ฌ์ดํŠธ๋ฅผ ์ฐพ์•„๋ณด์•˜์œผ๋‚˜, dcm์—์„œ ply๋กœ ํŒŒ์ผ์ด ๋ณ€ํ™˜๋˜์ง€ ์•Š์Œ.(์„ ํƒ ์˜ต์…˜์—๋Š” ์žˆ์œผ๋‚˜, ๋ณ€ํ™˜ ์‹คํŒจ)
  2. ์†”๋ฃจ์…˜ ๋ฐ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ์ฐพ์•„๋ด„ Medit Link sw image mathworks stackoverflow๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ vtk.js๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ง์ ‘ converter๋ฅผ ๊ตฌํ˜„ํ•ด๋ณด๊ณ ์ž ํ•จ

converter ๊ตฌํ˜„ ์‹œ๋„_230609 (๋ณ€ํ™˜ ์‹คํŒจ)

A-2. ply ํŒŒ์ผ์„ ๋žœ๋”๋ง

๊ณ ๋ คํ•˜๊ธฐ

๊ธฐ์กด์— ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋กœ ํ† ๋Œ€๋กœ, geometry ์š”์†Œ๋ฅผ ์ง์ ‘ createํ•˜๊ฑฐ๋‚˜, glbํŒŒ์ผ์„ ๋กœ๋“œํ•˜์—ฌ ์ž‘์—…ํ•ด๋ณธ ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฒˆ ์ž‘์—…์— ์ƒˆ๋กœ ๊ณ ๋ คํ•ด์•ผ ํ•  ์ ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ตฌํ˜„ ๋ชฉํ‘œ

๋‹จ์œ„ ์ž‘์—… ๋ชฉํ‘œ

dusunax commented 1 year ago

PLYModel ์—๋Ÿฌ ํ™•์ธ ๋ฐ ํ•ด๊ฒฐ

230610, 2์‹œ~3์‹œ๋ฐ˜ ์ง„ํ–‰

๋ฌธ์ œ ์›์ธ ์ฐพ๊ธฐ - threeJS์˜ ๊ฐ object ํ™•์ธ

๋žœ๋”๋Ÿฌ

Scene

loader

geometry

mesh

camera

โ›” OrbitControls โ›”

console.log(camera);

const controls = new OrbitControls(camera); // ์—ฌ๊ธฐ controls.enableZoom = true; controls.autoRotate = true;


- ํƒ€์ž… ํ™•์ธ => ๋‘๋ฒˆ์งธ ์ธ์ž๋กœ container ๋„˜๊ธฐ๋Š” ์ฝ”๋“œ ์ถ”๊ฐ€
```tsx
(alias) new OrbitControls(object: THREE.Camera, domElement?: HTMLElement | undefined): OrbitControls
import OrbitControls
Orbit controls allow the camera to orbit around a target.

@param object
The camera to be controlled. The camera must not be a child of another object, unless that object is the scene itself.

@param domElement
The HTML element used for event listeners.
const controls = new OrbitControls(camera, container);
controls.enableZoom = true;
controls.autoRotate = true;

์—๋Ÿฌ ํ•ด๊ฒฐ ํ›„ ๐Ÿ› 

dusunax commented 1 year ago

๋‘ ๊ฐ€์ง€ ๋žœ๋”๋ง ๋ฐฉ๋ฒ• ๊ตฌํ˜„

๋žœ๋”๋ง์˜ ๊ฒฝ์šฐ

  1. ์ตœ์ดˆ ๋กœ๋”ฉ ์‹œ, string์„ ์ „๋‹ฌ, loadPLYModelBySrc(๋””ํดํŠธ) โ‡’ ์„  ์ž‘์—… ์™„๋ฃŒ
  2. ์œ ์ € input ์‹œ, File์„ ์ „๋‹ฌ, loadPLYModelByFile โ‡’ ์ž‘์—… ์ค‘

ํ•จ์ˆ˜ ๋ถ„๋ฆฌ

โ›” ํ˜„์žฌ ๋ฌธ์ œ์  230611 (์˜ค์ „ 1์‹œ) โ›”

dusunax commented 1 year ago

Close issue and move to the next documentation.