Skip to content

Instantly share code, notes, and snippets.

View tfmoraes's full-sized avatar

Thiago Franco de Moraes tfmoraes

View GitHub Profile
class Gdcm < Formula
desc "Grassroots DICOM library and utilities for medical files"
homepage "https://sourceforge.net/projects/gdcm/"
url "https://downloads.sourceforge.net/project/gdcm/gdcm%202.x/GDCM%202.8.9/gdcm-2.8.9.tar.gz"
sha256 "a2da88b7b3cbf9e76a9df3e89d06d057cca9ce54fc62fb059e04f47bf056b727"
bottle do
sha256 "9f3d3a1de707e4184bc62fa7070fccb39c9fd1864966e49dc58e93c0616ec012" => :mojave
sha256 "ad87ce2f85f16278131b692b12c33cbf1f02af7263c04a9b3dc1cb8188bcdf53" => :high_sierra
sha256 "ba985660d7000a4f8b054a63269c60cab9c542e46e81864d8ef8621c2a246cbf" => :sierra
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)
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 );
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()
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 April 10, 2016 22:49
Formula to compile gdcm with vtk6.3 (and possibly vtk7)
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 July 9, 2019 20:47
Patches to Compile gdcm with VTK6 and VTK7
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 $")
@tfmoraes
tfmoraes / neovim fzf
Created April 15, 2015 19:43
neovim fzf
call plug#begin('~/.nvim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' }
call plug#end()
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 October 14, 2012 01:02
plotting an arrays as image
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],