Giter VIP home page Giter VIP logo

crop-boxes-3d's Introduction

Crop boxes in 3D images

This script uses SimpleITK to read medical images and OpenCV for the GUI in order to provide a simple and fast way to crop 3D boxes (for instance to generate ground truth for a classifier). It is a 3D adaptation of [1].

Usage

ESC or q : exit
SPACE : save box
ENTER : skip, go to the next file without saving.

If a cropped box is already found, the file is skipped, so to change a cropped box, you need to delete the corresponding png.

A regular expression to parse the png files is:

import re
pattern =  r'(?P<raw_file>[^/]+\.nii)_(?P<z>\d+)_(?P<y>\d+)_(?P<x>\d+)_(?P<d>\d+)_(?P<h>\d+)_(?P<w>\d+)\.png$'
match = re.search( pattern, filename )
m = match.groupdict()

See ./run.sh for an example for cropping, and ./parse.py ground_truth/ boxes.txt for an example for parsing the cropped boxes to a text file.

Screenshot

Reference

[1] N. Seo. Imageclipper - A Tool to Crop Images Manually Fast. Imageclipper, 2008. https://code.google.com/p/imageclipper/

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.