Skip to content

Instantly share code, notes, and snippets.

Avatar

Thiago Franco de Moraes tfmoraes

View GitHub Profile
View vtkgdcm_compile.diff
diff --git a/Utilities/VTK/vtkImageColorViewer.cxx b/Utilities/VTK/vtkImageColorViewer.cxx
index 3d6df39..ea857ef 100644
--- a/Utilities/VTK/vtkImageColorViewer.cxx
+++ b/Utilities/VTK/vtkImageColorViewer.cxx
@@ -539,7 +539,15 @@ public:
if (event == vtkCommand::ResetWindowLevelEvent)
{
-#if (VTK_MAJOR_VERSION >= 6)
+#if VTK_MAJOR_VERSION > 7 || (VTK_MAJOR_VERSION == 7 && VTK_MINOR_VERSION >= 1)
View gdcm_vtk8.patch
diff --git a/Utilities/VTK/vtkGDCMPolyDataWriter.cxx b/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
index e2c661c39..62eda25f5 100644
--- a/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
+++ b/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
@@ -586,7 +586,11 @@ void vtkGDCMPolyDataWriter::WriteRTSTRUCTData(gdcm::File &file, int pdidx )
if( darray )
{
double tuple[3];
+#if (VTK_MAJOR_VERSION >= 8)
+ darray->GetTypedTuple( 0, tuple );
View surface.patch
diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py
index 8845085..79ba515 100644
--- a/invesalius/data/surface.py
+++ b/invesalius/data/surface.py
@@ -774,16 +774,16 @@ class SurfaceManager():
session = ses.Session()
session.ChangeProject()
- # The following lines have to be here, otherwise all volumes disappear
- measured_polydata = vtk.vtkMassProperties()
View inv_non_gui.patch
diff --git a/app.py b/app.py
index a2b76f9..cd4c055 100755
--- a/app.py
+++ b/app.py
@@ -198,7 +198,8 @@ class SplashScreen(wx.SplashScreen):
self.control = Controller(self.main)
self.fc = wx.FutureCall(1, self.ShowMain)
- wx.FutureCall(1, parse_comand_line)
+ options, args = parse_comand_line()
@tfmoraes
tfmoraes / gdcm.rb
Created Apr 10, 2016
Formula to compile gdcm with vtk6.3 (and possibly vtk7)
View gdcm.rb
class Gdcm < Formula
desc "Grassroots DICOM library and utilities for medical files"
homepage "http://sourceforge.net/projects/gdcm/"
url "http://heanet.dl.sourceforge.net/project/gdcm/gdcm%202.x/GDCM%202.6.3/gdcm-2.6.3.tar.bz2"
sha256 "7882e880b8b60efc66a492ae3c1c161799340ad62a90d690823b76eb400c0a8f"
bottle do
sha256 "5e480698f28f6a3d7e16eeec541feb9b6e0ec24edfe4f3c5c35c11f80895d28d" => :el_capitan
sha256 "1d046333077cc1f5325247a9f23260cabc1fe6152c75ddd0333e1ad14bcbdf46" => :yosemite
sha256 "be5cf5f2ffd1d68322a01d22de4f119366fb26cecb9484c801819ec988d804bf" => :mavericks
@tfmoraes
tfmoraes / 01_vtkCxxRevisionMacro.patch
Last active Jul 9, 2019
Patches to Compile gdcm with VTK6 and VTK7
View 01_vtkCxxRevisionMacro.patch
diff --git a/Utilities/VTK/Applications/gdcmviewer.cxx b/Utilities/VTK/Applications/gdcmviewer.cxx
index 57facd6..a74c1f5 100644
--- a/Utilities/VTK/Applications/gdcmviewer.cxx
+++ b/Utilities/VTK/Applications/gdcmviewer.cxx
@@ -118,7 +118,7 @@ public:
double GetOverlayVisibility() { return 0; }
void SetOverlayVisibility(double vis) {(void)vis;}
};
-vtkCxxRevisionMacro(vtkGDCMImageViewer, "$Revision: 1.30 $")
+//vtkCxxRevisionMacro(vtkGDCMImageViewer, "$Revision: 1.30 $")
View neovim fzf
call plug#begin('~/.nvim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' }
call plug#end()
View vtk_brew.patch
diff --git a/Library/Formula/vtk.rb b/Library/Formula/vtk.rb
index 073e90f..5858228 100644
--- a/Library/Formula/vtk.rb
+++ b/Library/Formula/vtk.rb
@@ -35,6 +35,7 @@ class Vtk < Formula
-DBUILD_SHARED_LIBS=ON
-DCMAKE_INSTALL_RPATH:STRING='#{lib}/vtk-5.10'
-DCMAKE_INSTALL_NAME_DIR:STRING='#{lib}/vtk-5.10'
+ -DIOKit:FILEPATH=/System/Library/Frameworks/IOKit.framework
]
@tfmoraes
tfmoraes / imshow.py
Created Oct 14, 2012
plotting an arrays as image
View imshow.py
import pylab
a = [[1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2],
[1, 1, 2, 2, 2, 1, 2, 3, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 2, 3],
[2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 3, 1],
[2, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1],
[1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2],
[1, 1, 1, 1, 3, 1, 2, 3, 1, 2, 4, 1, 1, 2, 1, 2, 1, 2, 2, 2, 2],
[1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
View traceback_memmap.py
<traceback>
Process Process-1:
Traceback (most recent call last):
File "C:\Python26\Lib\multiprocessing\process.py", line 232, in _bootstrap
self.run()
File "C:\Python26\Lib\multiprocessing\process.py", line 88, in run
self._target(*self._args, **self._kwargs)
File "C:\Documents and Settings\phamorim\Desktop\test.py", line 7, in print_ma
trix
print matrix