├── MPR ├── Dataset │ └── quarter │ │ ├── quarter.1 │ │ ├── quarter.10 │ │ ├── quarter.11 │ │ ├── quarter.12 │ │ ├── quarter.13 │ │ ├── quarter.14 │ │ ├── quarter.15 │ │ ├── quarter.16 │ │ ├── quarter.17 │ │ ├── quarter.18 │ │ ├── quarter.19 │ │ ├── quarter.2 │ │ ├── quarter.20 │ │ ├── quarter.21 │ │ ├── quarter.22 │ │ ├── quarter.23 │ │ ├── quarter.24 │ │ ├── quarter.25 │ │ ├── quarter.26 │ │ ├── quarter.27 │ │ ├── quarter.28 │ │ ├── quarter.29 │ │ ├── quarter.3 │ │ ├── quarter.30 │ │ ├── quarter.31 │ │ ├── quarter.32 │ │ ├── quarter.33 │ │ ├── quarter.34 │ │ ├── quarter.35 │ │ ├── quarter.36 │ │ ├── quarter.37 │ │ ├── quarter.38 │ │ ├── quarter.39 │ │ ├── quarter.4 │ │ ├── quarter.40 │ │ ├── quarter.41 │ │ ├── quarter.42 │ │ ├── quarter.43 │ │ ├── quarter.44 │ │ ├── quarter.45 │ │ ├── quarter.46 │ │ ├── quarter.47 │ │ ├── quarter.48 │ │ ├── quarter.49 │ │ ├── quarter.5 │ │ ├── quarter.50 │ │ ├── quarter.51 │ │ ├── quarter.52 │ │ ├── quarter.53 │ │ ├── quarter.54 │ │ ├── quarter.55 │ │ ├── quarter.56 │ │ ├── quarter.57 │ │ ├── quarter.58 │ │ ├── quarter.59 │ │ ├── quarter.6 │ │ ├── quarter.60 │ │ ├── quarter.61 │ │ ├── quarter.62 │ │ ├── quarter.63 │ │ ├── quarter.64 │ │ ├── quarter.65 │ │ ├── quarter.66 │ │ ├── quarter.67 │ │ ├── quarter.68 │ │ ├── quarter.69 │ │ ├── quarter.7 │ │ ├── quarter.70 │ │ ├── quarter.71 │ │ ├── quarter.72 │ │ ├── quarter.73 │ │ ├── quarter.74 │ │ ├── quarter.75 │ │ ├── quarter.76 │ │ ├── quarter.77 │ │ ├── quarter.78 │ │ ├── quarter.79 │ │ ├── quarter.8 │ │ ├── quarter.80 │ │ ├── quarter.81 │ │ ├── quarter.82 │ │ ├── quarter.83 │ │ ├── quarter.84 │ │ ├── quarter.85 │ │ ├── quarter.86 │ │ ├── quarter.87 │ │ ├── quarter.88 │ │ ├── quarter.89 │ │ ├── quarter.9 │ │ ├── quarter.90 │ │ ├── quarter.91 │ │ ├── quarter.92 │ │ └── quarter.93 ├── Documentation │ ├── mpr_document.pdf │ └── mpr_document.tex ├── screenshots │ ├── Multi_planar_viewer_window.jpeg │ ├── multi_planar_reconstruction.jpeg │ ├── multiplanar_reconstruction_oblique_plane.png │ ├── rotated_mpr.jpeg │ ├── traverse_view.png │ └── zoom_standard_planes.jpeg └── src │ ├── slicer.py │ └── slicer_read_Dataset.py └── README.md /MPR/Dataset/quarter/quarter.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.1 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.10 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.11 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.12 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.13 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.14 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.15: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.15 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.16 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.17: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.17 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.18: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.18 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.19: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.19 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.2 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.20 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.21 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.22: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.22 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.23: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.23 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.24: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.24 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.25: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.25 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.26: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.26 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.27: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.27 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.28: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.28 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.29: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.29 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.3 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.30: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.30 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.31: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.31 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.32 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.33: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.33 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.34: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.34 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.35: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.35 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.36: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.36 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.37: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.37 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.38: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.38 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.39: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.39 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.4 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.40: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.40 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.41: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.41 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.42: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.42 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.43 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.44: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.44 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.45: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.45 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.46: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.46 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.47: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.47 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.48: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.48 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.49: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.49 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.5 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.50: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.50 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.51: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.51 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.52: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.52 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.53: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.53 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.54: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.54 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.55: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.55 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.56: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.56 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.57: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.57 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.58: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.58 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.59: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.59 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.6 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.60: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.60 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.61: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.61 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.62: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.62 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.63: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.63 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.64 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.65: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.65 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.66: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.66 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.67: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.67 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.68: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.68 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.69: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.69 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.7 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.70: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.70 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.71: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.71 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.72: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.72 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.73: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.73 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.74: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.74 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.75: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.75 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.76: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.76 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.77: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.77 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.78: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.78 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.79: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.79 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.8 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.80: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.80 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.81: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.81 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.82: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.82 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.83: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.83 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.84: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.84 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.85: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.85 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.86: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.86 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.87: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.87 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.88: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.88 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.89: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.89 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.9 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.90 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.91: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.91 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.92: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.92 -------------------------------------------------------------------------------- /MPR/Dataset/quarter/quarter.93: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Dataset/quarter/quarter.93 -------------------------------------------------------------------------------- /MPR/Documentation/mpr_document.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/Documentation/mpr_document.pdf -------------------------------------------------------------------------------- /MPR/Documentation/mpr_document.tex: -------------------------------------------------------------------------------- 1 | %\documentclass[12pt]{article} 2 | \documentclass[12pt]{report} 3 | \usepackage[margin=1.0in]{geometry} 4 | \usepackage{amsmath} 5 | \usepackage{xcolor} 6 | \usepackage{graphicx} 7 | \usepackage{subfig} 8 | \usepackage{hyperref} 9 | \hypersetup{ 10 | colorlinks, 11 | citecolor=black, 12 | filecolor=black, 13 | linkcolor=red, 14 | urlcolor=black 15 | } 16 | 17 | \title{\textbf{ \textcolor{red}{Project Report \\ on \\Multi-Planar Reconstruction using VTK } }} 18 | \author{ 19 | \vspace{ 2 mm}\\ 20 | Supervised By : \textbf{Prof. Srikanth T.K}\\ 21 | \vspace {2mm}\\ 22 | \textbf{Submitted by:} \\ 23 | srinivas.r.vaidya\\ 24 | (MT2013152) \\ 25 | \vspace{ -2 mm}\\ 26 | \textbf{@iiitb.org}} 27 | \date{14 - December - 2014} 28 | \begin{document} 29 | 30 | \maketitle 31 | 32 | \tableofcontents 33 | 34 | \vspace{ 100 mm} 35 | \chapter{Introduction} 36 | \section{\textcolor{blue}{Objective} } 37 | 38 | In medical imaging computed tomography (CT) and magnetic resonance imaging (MRI) provide three-dimensional volumetric data sets of the human body, which contain these objects of interest. The data gained from CT and MRI, however, contain many objects of less or no interest. This makes volume-rendering without preprocessing often impossible or inaccurate. Furthermore the objects of interest are hardly located entirely within a single plane. One way to display tubular structures for diagnostic purposes is to generate longitudinal cross-sections in order to show lumen, wall, and surrounding tissue in a curved plane. This process is called Curved Planar Reformation (CPR). This process is sometimes referred to as Multi Planar Reformation (MPR). 39 | 40 | \section{\textcolor{blue}{Motivation} } 41 | 42 | MPR are routinely used in examinations of the CP angles and cranial nerves, pituitary gland, solitary and multiple space occupying lesions of the brain, in the knee joint, and for examining the kypho-scoliotic spine[1]. 43 | 44 | \chapter{Functionality} 45 | \section{\textcolor{blue}{Multi Planar Viewer Window} } 46 | 47 | The window of the Multi Planar Viewer is divided into 4 parts: \\ 48 | 49 | \begin{itemize} 50 | \item Top right renderer displays 3D dataset. \\ 51 | \item Top left renderer displays an oblique axial plane. \\ 52 | \item Bottom left renderer displays sagittal plane. \\ 53 | \item Bottom right renderer displays axial plane. \\ 54 | \end{itemize} 55 | 56 | \begin{figure}[h] 57 | \centering 58 | \includegraphics[width=0.35\textwidth]{mpv.jpeg} 59 | \caption{Multi Planar Viewer Window} 60 | \end{figure} 61 | 62 | 63 | \section{\textcolor{blue}{Screen Pick Points} } 64 | User can pick points to draw a polyline on any plane in multiplanar viewer window to reconstruct a multiplanar image. User can also clear the previously drawn polyline, and a draw a fresh polyline. 65 | 66 | \section{\textcolor{blue}{MultiPlanar Reconstruction from standard plane} } 67 | The window displays MultiPlanar Reconstruction image generated from the polyline plotted on stadard plane(axial, sagittal) by user. 68 | 69 | \begin{figure}[h] 70 | \centering 71 | \includegraphics[width=0.35\textwidth]{mpr.jpeg} 72 | \caption{Multi Planar Viewer Window, shows MPR generated from points draw on axial plane} 73 | \end{figure} 74 | 75 | \section{\textcolor{blue}{MultiPlanar Reconstruction from oblique plane} } 76 | The window displays MultiPlanar Reconstruction image generated from the polyline plotted by user on an oblique plane. 77 | 78 | \begin{figure}[h] 79 | \centering 80 | \includegraphics[width=0.35\textwidth]{ob.png} 81 | \caption{Multi Planar Viewer Window, shows MPR generated from points draw on oblique plane (45$ \circ $ to axial plane)} 82 | \end{figure} 83 | 84 | \vspace{70pt} 85 | 86 | \section{\textcolor{blue}{Zoom} } 87 | User can change the zoom level in all planar views in multiplanar viewer window and in multiplanar reconstruction window. 88 | 89 | \begin{figure}[h] 90 | \centering 91 | \includegraphics[width=0.35\textwidth]{zoom.jpeg} 92 | \caption{Multi Planar Viewer Window} 93 | \end{figure} 94 | 95 | 96 | \section{\textcolor{blue}{Rotation} } 97 | All planar views in multiplanar viewer window and in multiplanar reconstruction window can be rotated. 98 | 99 | \begin{figure}[h] 100 | \centering 101 | \includegraphics[width=0.35\textwidth]{r.jpeg} 102 | \caption{Multi Planar Viewer Window} 103 | \end{figure} 104 | 105 | 106 | \vspace{200pt} 107 | 108 | \section{\textcolor{blue}{Traverse View} } 109 | All planar views in multiplanar viewer window can be traversed with up and down with constant depth(which can be programmed). 110 | 111 | \begin{figure}[h] 112 | \centering 113 | \subfloat[]{\includegraphics[width=0.25\textwidth]{01.jpeg} } 114 | \subfloat[]{\includegraphics[width=0.25\textwidth]{02.jpeg} } 115 | \subfloat[]{\includegraphics[width=0.25\textwidth]{03.jpeg} } 116 | %\caption{Traverse view of sagittal plane} 117 | \end{figure} 118 | 119 | \begin{figure}[h] 120 | \centering 121 | \subfloat[]{\includegraphics[width=0.25\textwidth]{11.png} } 122 | \subfloat[]{\includegraphics[width=0.25\textwidth]{12.png} } 123 | \subfloat[]{\includegraphics[width=0.25\textwidth]{13.png} } 124 | \caption{Traverse views of sagittal plane} 125 | \end{figure} 126 | 127 | \chapter{System Design} 128 | \section{\textcolor{blue}{Algorithm to obtain MPR} } 129 | \textbf{Step 1:} User pick points to draw a polyline(or piecewise linear curve) on any plane. \\ 130 | \textbf{Step 2:} Corresponding world space coordinates of the clicked screen coordinates is obtainted. \\ 131 | \textbf{Step 3:} If user has plotted n points, then are (n-1) edges. Length of each edge is computed by calculating (euclidean) distance between two vertices of edge. \\ 132 | \textbf{Step 4:} Angle of each edge is computed. \\ 133 | \textbf{Step 5:} Using angle and normal information of the plane on which this points are plotted, the orientation of the slicer is calculated and a slice is obtained. \\ 134 | \textbf{Step 6:} Using distance(as obtained by step 3), the slice is stripped to obtain only area of interest. \\ 135 | \textbf{Step 7:} Repeat Step 3 to Step 6 for every edge in the polyline. \\ 136 | \textbf{Step 8:} Using distance(as obtained by step 3) render window location of final stripped slice is determined.\\ 137 | \textbf{Step 9:} Render to view MPR 138 | 139 | 140 | \section{\textcolor{blue}{Code description} } 141 | \subsection{\textcolor{blue}{Variables} } 142 | 143 | \begin{itemize} 144 | \item 145 | \textit{clickPointsList:} A list which holds user click points in world space coordinates. \\ 146 | \item 147 | \textit{aSlice:} List of vtkImageReslice class object, each objects interpolation method, reslice axis, OutputDimensionality are set, and reads data directly from vtkVolume16Reader. \\ 148 | \item 149 | \textit{color:} List of vtkImageMapToColors class object, each objects lookuptable is set to a vtkLookupTable object. color object fetchs input from aslice object.\\ 150 | \item 151 | \textit{actor:} List of vtkImageActor class object. Each actor object inputs data from color object. \\ 152 | \item 153 | \textit{mpv\_renderer:} List of 4 objects of vtkRenderer class, which are responsible for 4 renderers in multiplanar viewer window. \\ 154 | \item 155 | \textit{numberOfSlices:} Holds number of slices that is composed to obtain final MPR image. Its value is (no:of click points) - 1 \\ 156 | \item 157 | \textit{extendLength:} A List which specify the extent length(strip excess or unimportant part) of each slice \\ 158 | \item 159 | \textit{setLocation:} A List which specify render window location of each slice strip. 160 | 161 | \end{itemize} 162 | 163 | \subsection{\textcolor{blue}{Procedures} } 164 | \begin{itemize} 165 | \item 166 | \underline{findDistanceBetweenTwoPoints:} returns euclidean distance between two vertices which is passed to this function \\ 167 | \item 168 | \underline{findAngleBetweenTwoPoints:} returns angle between two vertices which is passed to this function \\ 169 | \item 170 | \underline{computeMPR:} this function performs main algorithm. Three parameters passed are click points, standard plane on which points are drawn, oblique angle( = 0; if operating in standard plane) \\ 171 | \item 172 | \underline{displayClickPoints:} displays polyline from user click points \\ 173 | \item 174 | \underline{Mouse handler functions:} \\ 175 | - MouseMoveCallback \\ 176 | - LeftButtonPressEvent \\ 177 | \item 178 | \underline{Keyboard handler function:} \\ 179 | - KeyPressEvent \\ 180 | \\ 181 | \\ 182 | \\ 183 | \\ 184 | \\ 185 | \\ 186 | \end{itemize} 187 | 188 | %displayClickPoints 189 | 190 | \subsection{\textcolor{blue}{Data flow in VTK Pipeline} } 191 | 192 | \begin{figure}[h] 193 | \centering 194 | \includegraphics[width=0.95\textwidth]{vtk.png} 195 | \caption{Data flow in Visualization Toolkit pipelne performed for each edge in polyline. } 196 | \end{figure} 197 | 198 | 199 | \chapter{How to run} 200 | \section{\textcolor{blue}{Tools \& Installation} } 201 | On linux machine install python-vtk and python:\\ 202 | \\ 203 | \$sudo apt-get install python 204 | \\ 205 | \$sudo apt-get install libvtk5-dev python-vtk 206 | \\ 207 | \\ 208 | To test if python-vtk is correctly installed, the following command should start python-vtk interpreter. 209 | \\ 210 | \$python-vtk 211 | \\ 212 | \\ 213 | If still unable to run python-vtk interpreter, then 214 | \\ 215 | \$sudo apt-get update 216 | \\ 217 | will resolve any dependencies. 218 | 219 | \section{\textcolor{blue}{Where to get the source code} } 220 | 221 | Fork the repository or one could download the source code from the link given below: 222 | \\ 223 | \\ 224 | \href{https://github.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK}{https://github.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK} 225 | 226 | \section{\textcolor{blue}{How to run the code} } 227 | After installation, move to folder containing the source code. 228 | \\ 229 | \\ 230 | \$python slicer.py 231 | \\ 232 | \\ 233 | Two windows, \\1) Multiplanar viewer window, and 234 | \\ 235 | 2) Multiplanar reconstruction window, pop up. 236 | 237 | \section{\textcolor{blue}{How to plot points and render MPR} } 238 | On any plane in the multiplanar viewer window using mouse, pick points. \\ 239 | To render, press "R" or "r" 240 | 241 | \section{\textcolor{blue}{How to clear MPR} } 242 | To clear MPR, press "C" or "c" 243 | 244 | \section{\textcolor{blue}{How to rotate the MPR image} } 245 | Left mouse button down, and move the curser to get desired orientation. 246 | 247 | \section{\textcolor{blue}{How to traverse the planar view} } 248 | Click on the desired plane, and use scroll to traverse up or down. 249 | 250 | 251 | \chapter{Challenges faced, and what have been left open} 252 | 253 | \textbf{Some of challeges faced are,}\\ 254 | - To generate oblique MPR \\ 255 | - To set location of slice actor on the render window. \\ 256 | - To strip the desired location of the slice \\ 257 | - To get world coordinates from screen coordinates. 258 | \\ 259 | \\ 260 | \textbf{Some functionality left open,}\\ 261 | - To display polyline plotted by user. \\(Soln: Need to Append all your polygonal geometry with vtkAppendPolyData and pass it to vtkDepthSortPolyData.) \\ 262 | - Number of slices $\ge$ 5; size of strip displayed on MPR window decreases. \\ 263 | (This issue could be error in setLocation, or auto truncation by vtk, or both)\\ 264 | 265 | 266 | 267 | \chapter{References} 268 | 269 | [1] \textit{"Multi-planar Reconstructions in Routine Applications"} by Greg Brown, published at www.users.on.net 270 | 271 | \end{document} -------------------------------------------------------------------------------- /MPR/screenshots/Multi_planar_viewer_window.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/screenshots/Multi_planar_viewer_window.jpeg -------------------------------------------------------------------------------- /MPR/screenshots/multi_planar_reconstruction.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/screenshots/multi_planar_reconstruction.jpeg -------------------------------------------------------------------------------- /MPR/screenshots/multiplanar_reconstruction_oblique_plane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/screenshots/multiplanar_reconstruction_oblique_plane.png -------------------------------------------------------------------------------- /MPR/screenshots/rotated_mpr.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/screenshots/rotated_mpr.jpeg -------------------------------------------------------------------------------- /MPR/screenshots/traverse_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/screenshots/traverse_view.png -------------------------------------------------------------------------------- /MPR/screenshots/zoom_standard_planes.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srinivasrvaidya/Multi-Planar-Reconstruction-using-VTK/d316853fdc8f19a5c314a136e4d548ac6771f649/MPR/screenshots/zoom_standard_planes.jpeg -------------------------------------------------------------------------------- /MPR/src/slicer.py: -------------------------------------------------------------------------------- 1 | import vtk 2 | import math 3 | import numpy 4 | import slicer_read_Dataset 5 | from vtk.util.misc import vtkGetDataRoot 6 | VTK_DATA_ROOT = vtkGetDataRoot() 7 | 8 | DEBUG_MODE = 0 9 | 10 | #-------- Initialization ------------------ 11 | 12 | worldPicker = vtk.vtkWorldPointPicker() 13 | clickPointsList = [] 14 | renderer = vtk.vtkRenderer() 15 | aslice = range(10) 16 | color = range(10) 17 | actor = range(10) 18 | mpv_renderer = range(4) 19 | 20 | 21 | # Start by loading some data. 22 | reader = vtk.vtkImageReader2() 23 | reader.SetFilePrefix("../Dataset/quarter") 24 | reader.SetDataExtent(0, 63, 0, 63, 1, 93) 25 | reader.SetDataSpacing(1, 1, 1) 26 | #reader.SetDataSpacing(3.2, 3.2, 1.5) 27 | reader.SetDataOrigin(0.0, 0.0, 0.0) 28 | reader.SetDataScalarTypeToUnsignedShort() 29 | reader.UpdateWholeExtent() 30 | 31 | # Calculate the center of the volume 32 | reader.GetOutput().UpdateInformation() 33 | (xMin, xMax, yMin, yMax, zMin, zMax) = reader.GetOutput().GetWholeExtent() 34 | (xSpacing, ySpacing, zSpacing) = reader.GetOutput().GetSpacing() 35 | (x0, y0, z0) = reader.GetOutput().GetOrigin() 36 | 37 | center = [x0 + xSpacing * 0.5 * (xMin + xMax), 38 | y0 + ySpacing * 0.5 * (yMin + yMax), 39 | z0 + zSpacing * 0.5 * (zMin + zMax)] 40 | 41 | if DEBUG_MODE: 42 | print "Center: ", center 43 | print "(xMin, xMax, yMin, yMax, zMin, zMax)", xMin, xMax, yMin, yMax, zMin, zMax 44 | 45 | # ------------- Basic Planes ----------------------------- 46 | 47 | axial = vtk.vtkMatrix4x4() 48 | axial.DeepCopy((1, 0, 0, center[0], 49 | 0, 1, 0, center[1], 50 | 0, 0, 1, center[2], 51 | 0, 0, 0, 1)) 52 | 53 | coronal = vtk.vtkMatrix4x4() # x axis 54 | coronal.DeepCopy((1, 0, 0, center[0], 55 | 0, 0, 1, center[1], 56 | 0,-1, 0, center[2], 57 | 0, 0, 0, 1)) 58 | 59 | sagittal = vtk.vtkMatrix4x4() 60 | sagittal.DeepCopy((0, 0,-1, center[0], 61 | 1, 0, 0, center[1], 62 | 0,-1, 0, center[2], 63 | 0, 0, 0, 1)) 64 | 65 | #Oblique slice. 66 | obliqueSlice = vtk.vtkImageReslice() 67 | obliqueSlice.SetInputConnection(reader.GetOutputPort()) 68 | obliqueSlice.SetOutputDimensionality(2) 69 | 70 | # Extract a slice in the desired orientation 71 | reslice_axial = vtk.vtkImageReslice() 72 | reslice_axial.SetInputConnection(reader.GetOutputPort()) 73 | reslice_axial.SetOutputDimensionality(2) 74 | reslice_axial.SetResliceAxes(axial) 75 | reslice_axial.SetInterpolationModeToLinear() 76 | 77 | # Extract a slice in the desired orientation 78 | reslice_coronal = vtk.vtkImageReslice() 79 | reslice_coronal.SetInputConnection(reader.GetOutputPort()) 80 | reslice_coronal.SetOutputDimensionality(2) 81 | reslice_coronal.SetResliceAxes(coronal) 82 | reslice_coronal.SetInterpolationModeToLinear() 83 | 84 | 85 | # Extract a slice in the desired orientation 86 | reslice_sagittal = vtk.vtkImageReslice() 87 | reslice_sagittal.SetInputConnection(reader.GetOutputPort()) 88 | reslice_sagittal.SetOutputDimensionality(2) 89 | reslice_sagittal.SetResliceAxes(sagittal) 90 | reslice_sagittal.SetInterpolationModeToLinear() 91 | 92 | 93 | # Create a greyscale lookup table 94 | table = vtk.vtkLookupTable() 95 | table.SetRange(0, 2000) # image intensity range 96 | table.SetValueRange(0.0, 1.0) # from black to white 97 | table.SetSaturationRange(0.0, 0) 98 | table.SetRampToLinear() 99 | table.Build() 100 | 101 | 102 | # Map the image through the lookup table 103 | color_axial = vtk.vtkImageMapToColors() 104 | color_axial.SetLookupTable(table) 105 | color_axial.SetInputConnection(reslice_axial.GetOutputPort()) 106 | 107 | # Display the image 108 | actor_axial = vtk.vtkImageActor() 109 | actor_axial.SetInput(color_axial.GetOutput()) 110 | 111 | 112 | # Map the image through the lookup table 113 | color_coronal = vtk.vtkImageMapToColors() 114 | color_coronal.SetLookupTable(table) 115 | color_coronal.SetInputConnection(reslice_coronal.GetOutputPort()) 116 | 117 | # Display the image 118 | actor_coronal = vtk.vtkImageActor() 119 | actor_coronal.SetInput(color_coronal.GetOutput()) 120 | 121 | # Map the image through the lookup table 122 | color_sagittal = vtk.vtkImageMapToColors() 123 | color_sagittal.SetLookupTable(table) 124 | color_sagittal.SetInputConnection(reslice_sagittal.GetOutputPort()) 125 | 126 | # Display the image 127 | actor_sagittal = vtk.vtkImageActor() 128 | actor_sagittal.SetInput(color_sagittal.GetOutput()) 129 | 130 | #ObliqueSlice 131 | obliqueSlice.SetResliceAxesOrigin(center[0], center[1], center[2]) 132 | 133 | obliqueSlice.SetResliceAxesDirectionCosines(1, 0, 0, 134 | 0, math.cos(math.radians(45)), -math.sin(math.radians(45)), 135 | 0, math.sin(math.radians(45)), math.cos(math.radians(45)) ) 136 | obliqueSlice.SetInterpolationModeToLinear() 137 | 138 | color_oblique = vtk.vtkImageMapToColors() 139 | color_oblique.SetLookupTable(table) 140 | color_oblique.SetInputConnection(obliqueSlice.GetOutputPort()) 141 | 142 | 143 | actor_oblique = vtk.vtkImageActor() 144 | actor_oblique.SetInput(color_oblique.GetOutput()) 145 | #actor[i].SetPosition(setLocation[i],0,0) 146 | 147 | 148 | #----------------------------------------------------------------- 149 | 150 | def findDistanceBetweenTwoPoints(startPoint, endPoint): 151 | 152 | dist = 0.0 153 | for i in range(0,3): 154 | dist += math.pow((endPoint[i] - startPoint[i]),2) 155 | 156 | return math.sqrt(dist) 157 | 158 | def findAngleBetweenTwoPoints(startPoint, endPoint): 159 | 160 | delY = endPoint[1] - startPoint[1] 161 | delX = endPoint[0] - startPoint[0] 162 | 163 | if delX == 0 and delY >= 0: 164 | return math.degrees(numpy.arctan(-float('inf'))) 165 | elif delX == 0 and delY < 0: 166 | return math.degrees(numpy.arctan(float('inf'))) 167 | else: 168 | return math.degrees(numpy.arctan( delY / delX )) 169 | 170 | 171 | def computeMPR(endPoints, plane, planeAngle): 172 | 173 | numberOfSlices = len(endPoints)-1 174 | points = [[0 for x in range(3)] for x in range(len(endPoints)-1)] 175 | 176 | angle = range(numberOfSlices) 177 | 178 | extentLength = [[0 for x in range(len(endPoints))] for x in range(len(endPoints))] 179 | 180 | setLocation = range(numberOfSlices) 181 | distance = range(numberOfSlices) 182 | 183 | print "-", planeAngle 184 | 185 | for i in range(0, numberOfSlices): 186 | for j in range(0,3): 187 | points[i][j] = (endPoints[i][j] + endPoints[i+1][j]) * 0.5 188 | 189 | if DEBUG_MODE: 190 | print "Mid Point:: [",i,",],[",j,"] :: ",points[i][j] 191 | 192 | for i in range(0, numberOfSlices): 193 | distance[i] = findDistanceBetweenTwoPoints(endPoints[i], endPoints[i+1]) 194 | angle[i] = findAngleBetweenTwoPoints(endPoints[i], endPoints[i+1]) 195 | 196 | if DEBUG_MODE: 197 | print "For the points:: ",endPoints[i]," and ", endPoints[i+1] 198 | print "Distance: ",distance[i],"Angle: ", angle[i] 199 | 200 | temp = -40 201 | 202 | for i in range(0, numberOfSlices): 203 | extentLength[i][0] = distance[i] #* 0.95 204 | extentLength[i][1] = 94 205 | temp += distance[i] 206 | setLocation[i] = temp #* 0.05 207 | 208 | for i in range(0, numberOfSlices): 209 | 210 | aslice[i] = vtk.vtkImageReslice() 211 | aslice[i].SetInputConnection(reader.GetOutputPort()) 212 | aslice[i].SetOutputDimensionality(2) 213 | aslice[i].SetResliceAxesOrigin(points[i][0] * aslice[i].GetOutput().GetSpacing()[0], 214 | points[i][1] * aslice[i].GetOutput().GetSpacing()[1], 215 | points[i][2] * aslice[i].GetOutput().GetSpacing()[2]) 216 | 217 | aslice[i].SetResliceAxesDirectionCosines(1, 0, 0, 218 | 0, math.cos(math.radians( float(planeAngle) )), -math.sin(math.radians( float(planeAngle)) ), 219 | 0, math.sin(math.radians( float(planeAngle) )), math.cos(math.radians( float(planeAngle) )) ) 220 | aslice[i].SetInterpolationModeToLinear() 221 | 222 | transform = vtk.vtkTransform() # rotate about the center of the image 223 | 224 | transform.Translate(center[0], center[1], center[2] ) 225 | transform.RotateZ(angle[i]) 226 | transform.Translate(-center[0], -center[1], -center[2] ) 227 | 228 | transform.Translate(center[0]-points[i][0], center[1]-points[i][1], center[2]-points[i][2]) # -10, 0, 0 229 | 230 | aslice[i].SetResliceTransform(transform) 231 | 232 | aslice[i].SetOutputExtent(0,extentLength[i][0],0,extentLength[i][1],0,0) 233 | 234 | color[i] = vtk.vtkImageMapToColors() 235 | color[i].SetLookupTable(table) 236 | color[i].SetInputConnection(aslice[i].GetOutputPort()) 237 | 238 | 239 | actor[i] = vtk.vtkImageActor() 240 | actor[i].SetInput(color[i].GetOutput()) 241 | actor[i].SetPosition(setLocation[i],0,0) 242 | 243 | # renderer.AddActor2D(actor[i]) 244 | 245 | #---------------------------------------------------------------------------------- 246 | 247 | # --- multi-view --- 248 | rw = vtk.vtkRenderWindow() 249 | 250 | # Set up the interaction 251 | interactorStyle = vtk.vtkInteractorStyleImage() 252 | interactor = vtk.vtkRenderWindowInteractor() 253 | interactor.SetInteractorStyle(interactorStyle) 254 | rw.SetInteractor(interactor) 255 | 256 | # --------- another window() ------------ 257 | mpr_rw = vtk.vtkRenderWindow() 258 | mpr_iren = vtk.vtkRenderWindowInteractor() 259 | mpr_iren.SetRenderWindow(mpr_rw) 260 | 261 | 262 | # Create callbacks for slicing the image 263 | actions = {} 264 | actions["Slicing"] = 0 265 | mode = 4 266 | 267 | def ButtonCallback(obj, event): 268 | 269 | if event == "LeftButtonPressEvent": 270 | actions["Slicing"] = 1 271 | else: 272 | actions["Slicing"] = 0 273 | 274 | x, y = obj.GetInteractor().GetEventPosition() 275 | 276 | global mode 277 | if x < 300 and y < 300: 278 | mode = 0 #"SAGITTAL" 279 | elif x < 600 and y < 300: 280 | mode = 1 #"AXIAL" 281 | elif x > 300 and y > 300: 282 | mode = 3 #"CORONAL" 283 | else: 284 | mode = 4 285 | 286 | 287 | def MouseMoveCallback(obj, event): 288 | (lastX, lastY) = interactor.GetLastEventPosition() 289 | (mouseX, mouseY) = interactor.GetEventPosition() 290 | if actions["Slicing"] == 1: 291 | deltaY = mouseY - lastY 292 | 293 | if deltaY > 0: 294 | deltaY = 5 295 | else: 296 | deltaY = -5 297 | 298 | if mode == 3: #"CORONAL": 299 | reslice_coronal.Update() 300 | sliceSpacing = reslice_coronal.GetOutput().GetSpacing()[2] 301 | matrix = reslice_coronal.GetResliceAxes() 302 | elif mode == 1: #"AXIAL": 303 | reslice_axial.Update() 304 | sliceSpacing = reslice_axial.GetOutput().GetSpacing()[2] 305 | matrix = reslice_axial.GetResliceAxes() 306 | elif mode == 0: #"SAGITTAL": 307 | reslice_sagittal.Update() 308 | sliceSpacing = reslice_sagittal.GetOutput().GetSpacing()[2] 309 | matrix = reslice_sagittal.GetResliceAxes() 310 | else: 311 | # print " -- 3d model clicked -- " 312 | return; 313 | 314 | # move the center point that we are slicing through 315 | center = matrix.MultiplyPoint((0, 0, sliceSpacing*deltaY, 1)) 316 | matrix.SetElement(0, 3, center[0]) 317 | matrix.SetElement(1, 3, center[1]) 318 | matrix.SetElement(2, 3, center[2]) 319 | rw.Render() 320 | rw.Render() 321 | else: 322 | interactorStyle.OnMouseMove() 323 | 324 | 325 | 326 | def LeftButtonPressEvent(obj,event): 327 | 328 | global ren, smart, mode , clickPoints, polygonActor, polygon, polygonMapper, renderer 329 | 330 | points = vtk.vtkPoints() 331 | points.SetNumberOfPoints(6) 332 | 333 | 334 | x, y = obj.GetInteractor().GetEventPosition() 335 | worldPicker.Pick(x,y,0,mpv_renderer[1]) 336 | worldPos = worldPicker.GetPickPosition() 337 | singleClickedPoint = [worldPos[0]+center[0], worldPos[1]+center[1], worldPos[2]+center[2]] 338 | 339 | clickPointsList.append(singleClickedPoint) 340 | 341 | displayClickPoints(clickPointsList) 342 | 343 | if DEBUG_MODE: 344 | print "Screen Coordinates:: ", x, y 345 | print "Mode:: ",mode 346 | print "Real world co-ordinates:: ",worldPos[0]+center[0], worldPos[1]+center[1], worldPos[2]+center[2] 347 | print "ClickPoints:: " 348 | print " ",clickPointsList 349 | # obj.OnLeftButtonDown() 350 | return 351 | 352 | def displayClickPoints(clickPoints): 353 | 354 | points = vtk.vtkPoints() 355 | lines = vtk.vtkCellArray() 356 | polygon = vtk.vtkPolyData() 357 | polygonMapper = vtk.vtkPolyDataMapper() 358 | polygonActor = vtk.vtkActor() 359 | 360 | points.SetNumberOfPoints(4) 361 | points.SetPoint(0, 0.0, -1.0, 0.0) 362 | points.SetPoint(1, -0.7, -0.5, 0.0) 363 | points.SetPoint(2, 0.7, 0.5, 0.0) 364 | points.SetPoint(3, 0.0, -1.0, 0.0) 365 | 366 | 367 | lines.InsertNextCell(4) 368 | lines.InsertCellPoint(0) 369 | lines.InsertCellPoint(1) 370 | lines.InsertCellPoint(2) 371 | lines.InsertCellPoint(3) 372 | 373 | polygon.SetPoints(points) 374 | polygon.SetLines(lines) 375 | 376 | polygonMapper.SetInputConnection(polygon.GetProducerPort()) 377 | polygonActor.SetMapper(polygonMapper) 378 | 379 | mpv_renderer[1].ResetCamera() 380 | mpv_renderer[1].AddActor(polygonActor) 381 | rw.Render() 382 | 383 | 384 | def KeyPressEvent(obj, event): 385 | 386 | global actor, mpr_rw, renderer, singleClickedPoint, points 387 | 388 | keyCode = obj.GetKeyCode() 389 | 390 | if DEBUG_MODE: 391 | print "Key Pressed: ",obj.GetKeyCode() 392 | 393 | if keyCode in ['r', 'R']: # Render_Mode 394 | 395 | # computeMPR(clickPointsList, "Axial", 90) 396 | computeMPR(clickPointsList, "Axial", 90) 397 | renderer.ResetCamera() 398 | 399 | for i in range(0, len(clickPointsList) - 1): 400 | renderer.AddActor2D(actor[i]) 401 | 402 | mpr_rw.AddRenderer(renderer) 403 | mpr_rw.Render() 404 | 405 | if keyCode in ['c','C']: # ViewPort Clear Mode & Reset 406 | 407 | for i in range(0, len(clickPointsList) - 1): 408 | renderer.RemoveActor2D(actor[i]) 409 | 410 | mpr_rw.AddRenderer(renderer) 411 | mpr_rw.Render() 412 | 413 | del clickPointsList[:] 414 | 415 | #------ CALL BACK REGISTRATION -------------- 416 | 417 | interactorStyle.AddObserver("MouseMoveEvent", MouseMoveCallback) 418 | interactorStyle.AddObserver("LeftButtonPressEvent", ButtonCallback) 419 | interactorStyle.AddObserver("LeftButtonReleaseEvent", ButtonCallback) 420 | interactorStyle.AddObserver("LeftButtonPressEvent", LeftButtonPressEvent) 421 | interactor.AddObserver("KeyPressEvent", KeyPressEvent) 422 | 423 | #------ Define viewport ranges --------------- 424 | 425 | xmins=[0, .5 , 0, .5] 426 | xmaxs=[0.5, 1, 0.5, 1] 427 | ymins=[0, 0 ,.5, .5] 428 | ymaxs=[0.5, 0.5 ,1 ,1] 429 | 430 | points = [[20,60,47],[20,20,47],[40,20,47],[60,60,47]] 431 | 432 | numberOfSlices = len(points) - 1 433 | 434 | for i in range(0, 4): 435 | mpv_renderer[i] = vtk.vtkRenderer() 436 | mpv_renderer[i].SetViewport(xmins[i],ymins[i],xmaxs[i],ymaxs[i]) 437 | 438 | mpv_renderer[1].SetUseDepthPeeling(1) 439 | mpv_renderer[1].SetOcclusionRatio(0.5) 440 | 441 | 442 | mpv_renderer[2].AddViewProp(slicer_read_Dataset.volume) 443 | camera = mpv_renderer[2].GetActiveCamera() 444 | c = slicer_read_Dataset.volume.GetCenter() 445 | camera.SetFocalPoint(c[0], c[1], c[2]) 446 | camera.SetPosition(c[0] + 400, c[1], c[2]) 447 | camera.SetViewUp(0, 0, -1) 448 | 449 | 450 | displayClickPoints(clickPointsList) 451 | mpv_renderer[1].AddActor2D(actor_axial) 452 | mpv_renderer[3].AddActor2D(actor_oblique) 453 | mpv_renderer[0].AddActor2D(actor_sagittal) 454 | 455 | for i in range(0,4): 456 | rw.AddRenderer(mpv_renderer[i]) 457 | 458 | rw.SetWindowName("Multi Planar Viewer Window") 459 | rw.SetSize(600, 600) 460 | rw.Render() 461 | 462 | mpr_rw.SetWindowName("Multi Planar Reconstruction Window") 463 | mpr_rw.SetSize(600, 300) 464 | mpr_rw.Render() 465 | 466 | interactor.Start() 467 | 468 | #--------- Renderer numbering ------------ 469 | 470 | # renderer 0: BOTTOM LEFT 471 | # renderer 1: BOTTOM RIGHT 472 | # renderer 2: TOP LEFT 473 | # renderer 3: TOP RIGHT 474 | 475 | 476 | 477 | -------------------------------------------------------------------------------- /MPR/src/slicer_read_Dataset.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # This example reads a volume dataset and displays it via volume rendering. 4 | # 5 | import vtk 6 | 7 | from vtk.util.misc import vtkGetDataRoot 8 | 9 | # Create the renderer, the render window, and the interactor. The renderer 10 | # draws into the render window, the interactor enables mouse- and 11 | # keyboard-based interaction with the scene. 12 | #ren = vtk.vtkRenderer() 13 | #renWin = vtk.vtkRenderWindow() 14 | #renWin.AddRenderer(ren) 15 | #iren = vtk.vtkRenderWindowInteractor() 16 | #iren.SetRenderWindow(renWin) 17 | 18 | 19 | # The following reader is used to read a series of 2D slices (images) 20 | # that compose the volume. The slice dimensions are set, and the 21 | # pixel spacing. The data Endianness must also be specified. The reader 22 | # usese the FilePrefix in combination with the slice number to construct 23 | # filenames using the format FilePrefix.%d. (In this case the FilePrefix 24 | # is the root name of the file: quarter.) 25 | v16 = vtk.vtkVolume16Reader() 26 | v16.SetDataDimensions(64, 64) 27 | v16.SetImageRange(1, 93) 28 | v16.SetDataByteOrderToLittleEndian() 29 | v16.SetFilePrefix("../Dataset/quarter") 30 | v16.SetDataSpacing(3.2, 3.2, 1.5) 31 | #v16.SetDataSpacing(1, 1, 1) 32 | 33 | # The volume will be displayed by ray-cast alpha compositing. 34 | # A ray-cast mapper is needed to do the ray-casting, and a 35 | # compositing function is needed to do the compositing along the ray. 36 | rayCastFunction = vtk.vtkVolumeRayCastCompositeFunction() 37 | volumeMapper = vtk.vtkVolumeRayCastMapper() 38 | volumeMapper.SetInput(v16.GetOutput()) 39 | volumeMapper.SetVolumeRayCastFunction(rayCastFunction) 40 | 41 | 42 | # The color transfer function maps voxel intensities to colors. 43 | # It is modality-specific, and often anatomy-specific as well. 44 | # The goal is to one color for flesh (between 500 and 1000) 45 | # and another color for bone (1150 and over). 46 | volumeColor = vtk.vtkColorTransferFunction() 47 | volumeColor.AddRGBPoint(0, 0.0, 0.0, 0.0) 48 | volumeColor.AddRGBPoint(500, 1.0, 0.5, 0.3) 49 | volumeColor.AddRGBPoint(1000, 1.0, 0.5, 0.3) 50 | volumeColor.AddRGBPoint(1150, 1.0, 1.0, 0.9) 51 | 52 | 53 | # The opacity transfer function is used to control the opacity 54 | # of different tissue types. 55 | volumeScalarOpacity = vtk.vtkPiecewiseFunction() 56 | volumeScalarOpacity.AddPoint(0, 0.00) 57 | volumeScalarOpacity.AddPoint(500, 0.15) 58 | volumeScalarOpacity.AddPoint(1000, 0.15) 59 | volumeScalarOpacity.AddPoint(1150, 0.85) 60 | 61 | 62 | # The gradient opacity function is used to decrease the opacity 63 | # in the "flat" regions of the volume while maintaining the opacity 64 | # at the boundaries between tissue types. The gradient is measured 65 | # as the amount by which the intensity changes over unit distance. 66 | # For most medical data, the unit distance is 1mm. 67 | volumeGradientOpacity = vtk.vtkPiecewiseFunction() 68 | volumeGradientOpacity.AddPoint(0, 0.0) 69 | volumeGradientOpacity.AddPoint(90, 0.5) 70 | volumeGradientOpacity.AddPoint(100, 1.0) 71 | 72 | 73 | # The VolumeProperty attaches the color and opacity functions to the 74 | # volume, and sets other volume properties. The interpolation should 75 | # be set to linear to do a high-quality rendering. The ShadeOn option 76 | # turns on directional lighting, which will usually enhance the 77 | # appearance of the volume and make it look more "3D". However, 78 | # the quality of the shading depends on how accurately the gradient 79 | # of the volume can be calculated, and for noisy data the gradient 80 | # estimation will be very poor. The impact of the shading can be 81 | # decreased by increasing the Ambient coefficient while decreasing 82 | # the Diffuse and Specular coefficient. To increase the impact 83 | # of shading, decrease the Ambient and increase the Diffuse and Specular. 84 | volumeProperty = vtk.vtkVolumeProperty() 85 | volumeProperty.SetColor(volumeColor) 86 | volumeProperty.SetScalarOpacity(volumeScalarOpacity) 87 | volumeProperty.SetGradientOpacity(volumeGradientOpacity) 88 | volumeProperty.SetInterpolationTypeToLinear() 89 | volumeProperty.ShadeOn() 90 | volumeProperty.SetAmbient(0.4) 91 | volumeProperty.SetDiffuse(0.6) 92 | volumeProperty.SetSpecular(0.2) 93 | 94 | 95 | # The vtkVolume is a vtkProp3D (like a vtkActor) and controls the position 96 | # and orientation of the volume in world coordinates. 97 | volume = vtk.vtkVolume() 98 | volume.SetMapper(volumeMapper) 99 | volume.SetProperty(volumeProperty) 100 | 101 | # Finally, add the volume to the renderer 102 | #ren.AddViewProp(volume) 103 | 104 | # Set up an initial view of the volume. The focal point will be the 105 | # center of the volume, and the camera position will be 400mm to the 106 | # patient's left (whis is our right). 107 | ''' 108 | camera = ren.GetActiveCamera() 109 | c = volume.GetCenter() 110 | camera.SetFocalPoint(c[0], c[1], c[2]) 111 | camera.SetPosition(c[0] + 400, c[1], c[2]) 112 | camera.SetViewUp(0, 0, -1) 113 | ''' 114 | # Increase the size of the render window 115 | #renWin.SetSize(860, 680) 116 | # Interact with the data. 117 | #iren.Initialize() 118 | #renWin.Render() 119 | #iren.Start() 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Multi-Planar-Reconstruction-using-VTK 2 | ===================================== 3 | 4 | Generate Multi Planar Reconstruction from CT scan data using VTK-PYTHON. 5 | 6 | In medical imaging computed tomography (CT) and magnetic resonance imaging (MRI) provide three-dimensional volumetric data sets of the human body, which contain these objects of interest. The data gained from CT and MRI, however, contain many objects of less or no interest. This makes volume-rendering without preprocessing often impossible or inac- 7 | curate. Furthermore the objects of interest are hardly located entirely within a single plane. One way to display tubular structures for diagnostic purposes is to generate longitudinal 8 | cross-sections in order to show lumen, wall, and surrounding tissue in a curved plane. This process is sometimes referred to as Multi Planar Reformation (MPR). 9 | 10 | On linux machine install python-vtk and python: 11 | 12 | $sudo apt-get install python 13 | $sudo apt-get install libvtk5-dev python-vtk 14 | 15 | To test if python-vtk is correctly installed, the following command should start python- 16 | vtk interpreter. 17 | $python-vtk 18 | 19 | If still unable to run python-vtk interpreter, then 20 | $sudo apt-get update 21 | will resolve any dependencies. 22 | 23 | After installation, move to folder containing the source code. 24 | $python slicer.py 25 | 26 | On any plane in the multiplanar viewer window using mouse, pick points. 27 | 28 | To render, press ”R” or ”r” 29 | 30 | To clear MPR, press ”C” or ”c” 31 | 32 | Left mouse button down, and move the curser to get desired orientation. 33 | 34 | Click on the desired plane, and use scroll to traverse up or down. 35 | --------------------------------------------------------------------------------