Coder Social home page Coder Social logo

dcm2png's Introduction

dcm2png

개발 환경

  • python: 3.8
  • conda
  • poetry
$ conda create -n dcm2png python=3.8

개발

테스트

  • test 디렉토리 내에 테스트용 dicom 파일이 있는 dicom 디렉토리가 필요
  • 아래 명령을 실행하면 result 디렉토리에 조건별 다이콤에서 추출한 이미지 파일 생성
dcm2png/test $ python test.py

특이 사항

  • from pydicom.pixel_data_handlers에서 제공하는 함수들 중 일부를 수정하여 로컬 사본 사용
  • imageio에서 1-bit monochrome 픽셀을 jpg로 저장하지 못 함

사용법

to_png(file_path: Union[str, BinaryIO], windowing: {"center": int, "width": int} = None) -> bytes

import dcm2png

with open("dicom.png", "wb") as f:
    f.write(dcm2png.to_png("dicom.dcm", {"center": 60, "width": 400}))

dcm2png's People

Contributors

codepage949 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.