Giter Club home page Giter Club logo

io3d's Introduction

Build Status Coverage Status Documentation Status

io3d

This package contains set of functions used for reading and writing 3D data.

Install

Use anaconda

conda install -c mjirik -c conda-forge -c SimpleITK -c bioconda io3d

or

pip install io3d

You can use 3D viewer sed3 for visualization.

pip install sed3

Examples

Check the tutorial

Read and show data from url

import io3d
import matplotlib.pyplot as plt

datap = io3d.read("http://home.zcu.cz/~mjirik/lisa/sample_data/nrn4.pklz")
plt.imshow(datap.data3d[10,:,:], cmap='gray')
plt.show()

Get sample data

Data will be automatically downloaded to ~\data\

command line:

python -m io3d -l 3Dircadb1.1

Read data and see one slice

import io3d
from matplotlib import pyplot as plt

# get path the data stored in default data directory
pth = io3d.datasets.joinp("medical/orig/3Dircadb1.1/MASKS_DICOM/")
datap = io3d.read(pth)
print(datap.voxelsize_mm)
# size of voxel can be accessed also by datap["voxelsize_mm"]

# see slice 10
plt.imshow(datap.data3d[5,:,:], cmap='gray')
plt.show()

Intensity image data3d and voxelsize_mm can be accessed easier through the datap properies

Use object DataReader and see data in simple viewer

import io3d
import sed3

pth = io3d.datasets.joinp("medical/orig/3Dircadb1.1/MASKS_DICOM/")
dr = io3d.DataReader()
datap = dr.Get3DData(pth, dataplus_format=True)

ed = sed3.sed3(datap['data3d'])
ed.show()

Use CLI

python io3d/datareader.py -i ./sample_data/jatra_5mm/

Use it in your application - Qt Widget

import sys
from PyQt5 import QtGui
import io3d.datareaderqt

app = QtGui.QApplication(sys.argv)    
w = io3d.datereaderqt.DatareaderWidget()
w.show()
app.exec_()
datap = w.datap

load_widget

Dataset

Read more about dataset setup and how to use datasets.

Get sample data with io3d package:

python -m io3d -l 3Dircadb1.1

Get list of available datasets:

python -m io3d -L

... or download data:

io3d_sample_data

ct_head.rawiv

Put this data into sample_data dir.

File or directory checksum

python -m io3d -c directory_path

Specific dataset path

Some parts of dataset can be stored separately. You can set it by command

python -m io3d -ssdp "g:/Můj disk/data/biology/roots" "biology/roots"
python -m io3d -ssdp "g:/Můj disk/data/medical/orig/sliver07" "medical/orig/sliver07"

or you can edit ~\.io3d_cache.yaml

Get by url

Data can be downloaded from url. Just use URL instead of label. The local path can be specified by adding local path to the end of url separated by colon.'

python -m io3d.datasets -l http://home.zcu.cz/~mjirik/lisa/sample_data/biodur_sample.zip:biodur_sample/
python -m io3d.datasets -l https://downloads.openmicroscopy.org/images/OME-TIFF/2016-06/bioformats-artificial/time-series.ome.tif:biology/orig/roots

Read datasets coherently

import io3d
import matplotlib.pyplot as plt
datap1 = io3d.read_dataset("3Dircadb1", "data3d", 1)
datap2 = io3d.read_dataset("3Dircadb1", "bone", 1)
plt.imshow(datap1["data3d"][20,:,:], cmap="gray")
plt.contour(datap2["data3d"][20,:,:])
plt.show()

ircad

Now you can read the sliver07 dataset in the same way. Just put it in data/orig/medical/sliver07

import io3d
import matplotlib.pyplot as plt
datap1 = io3d.read_dataset("sliver07", "data3d", 1)
plt.imshow(datap1["data3d"][20,:,:], cmap="gray")
plt.show()

The path where the datafiles are looked for can be checked by get_dataset_path function.

import io3d.datasets
pth = io3d.datasets.get_dataset_path("sliver07", "data3d", 1)

io3d's People

Stargazers

李开宇 avatar  avatar Christian Ledermann avatar  avatar  avatar Cesare avatar Claudio Cimarelli avatar Wojciech Miłkowski avatar

Watchers

Miroslav Jiřík avatar Marek Lovčí avatar  avatar  avatar

io3d's Issues

hdf5

read file pattern h5 hdf5

Rozdílný rozsah hodnot mezi io3d a imageJ

Pokud otevřu dicom data v ImageJ tak mají hodnoty rozsah -1024 až 1023.
Pokud otevřu dicom data v io3d tak mají hodnoty rozsah -512 až 511!

Tohle mi způsobuje problémy při prahování, musel jsem upravit prahy v bodynavigation na rozsah <-512;511> aby fungovala segmentace (než jsem si toho všiml). Pravděpodobně jste k vytvoření bodynavigation používal data, která měla v io3d rozsah <-1024;1023>?

Který z rozsahů je správný?

testovaci_data: http://www.ircad.fr/softwares/3Dircadb/3Dircadb1/3Dircadb1.1.zip

io3d_bug

Implementace nástroje pro anonymizaci

soubor io3d/anon.py

  1. inspirace pro dicom

https://github.com/mjirik/io3d/blob/master/examples/pydicom_example.ipynb

  1. všechen kód musí být ve funcích
if __name__ == "__main__":
    main()
  1. navrnout rozhraní funkce file_anonymization()

    • parametry a podobně
    • whitelist = None, nebo list povolených dicom tagů
  2. recursive_anon()

    • pracuje s adresáři v cestě
    • uvnitř používá funki file_anonymization
    • vstupem je rovněž whitelist
  3. testy

nosetests tests\anon_test.py

  1. Vytvořit test pro adresář

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.