eDICOMViewer

electron 시작

1월 17, 2018 eDICOMViewer No comments

1.electron binary file을 download후

2.electron/resources 폴더에 app 폴더 생성

3.app 폴더 안에 package.json 파일 생성 및 아래 내용 추가

{
    "name"    : "DICOM-Viewer",
    "version" : "0.0",
    "main"    : "main.js"
}

4.main.js파일 생성 및 아래 내용 추가. 아래 예제는 electron document 시작 하기 처음 내용
대충 electron을 사용하여 window생성 및 index.html파일 load 수행

const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = require('url')

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win

function createWindow () {
  // Create the browser window.
  win = new BrowserWindow({width: 800, height: 600})

  // and load the index.html of the app.
  win.loadURL(url.format({
    pathname: path.join(__dirname, 'index.html'),
    protocol: 'file:',
    slashes: true
  }))

  // Open the DevTools.
  win.webContents.openDevTools()

  // Emitted when the window is closed.
  win.on('closed', () => {
    // Dereference the window object, usually you would store windows
    // in an array if your app supports multi windows, this is the time
    // when you should delete the corresponding element.
    win = null
  })
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)

// Quit when all windows are closed.
app.on('window-all-closed', () => {
  // On macOS it is common for applications and their menu bar
  // to stay active until the user quits explicitly with Cmd + Q
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  // On macOS it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  if (win === null) {
    createWindow()
  }
})

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

5.예제로 기존 svg.js interaction sample이 정상 구동되는지 확인하기 위해
기존 index.html을 그대로 사용

<html>
    <head>
        <title>test svg.js</title>
    </head>
    <body>
        <div id="drawing_svgjs_intersection"></div>   
        <script type="text/javascript" src="bundle.js"></script>
    </body>
</html>

6.bundle.js 파일을 copy. 모든 준비 완료

7.electron.exe 실행 시 정상적으로 구동되는거 확인

DICOM Viewer project 시작

1월 16, 2018 eDICOMViewer 23 comments

Project Name : DICOM Viewer

개인적으로 시간적 여유가 생겨, 기존부터 해야지 마음만 먹었던 project를 시작 하고자 합니다.

Open Souce Project이며, github : (https://github.com/scanhand/DICOMViewer)

DICOM File의 Header를 read 및 display가 주 목적이며, 몇몇 header는 modify 기능도 제공 합니다.

전체적인 project는 이전에 하고자 했던 electron base로 진행 하려고 합니다.

오랜만에 들어갔더니, 역시 활발하게 많은것이 update 되었네요.

electron web : https://electronjs.org/

우선 electron korea의 slack channel(http://electron-kr.slack.com)도 있기에 가입도 했습니다.

slack channel은 그다지 활발히 활동 중이지는 않는듯 하네요.

project 구조는 아래 그림과 같이 하고자 합니다.

DICOM Library는 DCMTK(http://dicom.offis.de/dcmtk.php.en)를 사용합니다.

DCMTK는 build된 binary file을 별도의 dll module로 wrapping해서 사용되며, 해당 dll module을 통해 node.js와도 연동 하게 됩니다.

Front End는 bootstrap과 다양한 javascript library를 사용하여, 구현 할 예정입니다.

eDICOMViewer

7월 15, 2016 eDICOMViewer No comments

이전 부터 free DICOM Viewer를 하나 만들었으면 하는 생각이 있었습니다.

일반적으로 주 목적이 viewer보다는 DICOM header정보를 보고 간혹 modify 기능을 제공하는 concept으로 만들까 합니다.

실제 DICOM을 많이 쓰시는 분중 외부로 자료를 배포 한다거나 자료에 참고 자료를 쓸때 개인 정보를 지운다거나 하는경우가 많이 있더군요.

기왕이면 쓰기 쉽게 javascript로 할까 생각 중입니다.

node.js로 기존 DCMTK library (https://github.com/commontk/DCMTK) 를 사용하게끔 interface만 만들어 주면 가능 할 듯하네요.

DICOM Web Application이 되겠네요.

이것도 electoron 이 있어서 가능합니다. 그 전에는 web application은 딴 세상이었는데 electron이 생각 자체를 바꿔 주었네요.

참고로 이전에 fee DICOM viewer를 만들려고 git hub에 repository 만 만들어 놓고 시작도 못하고 있네요… ㅡㅡ; (https://github.com/scanhand/DICOMEditor)

아래 내용이 readme.md 에 적어 놓았던 글귀 입니다.

Main application is base on electron. (first concept was .NET framwork by c#. But it changed concept to javascript.)

  • 2018-02-19 : eDICOMViewer 로 project name을 변경 함
  • 2018-01-16 : DICOMViewer 로 Open source project로 개발 시작