Skip to content

Instantly share code, notes, and snippets.

View jbvimort's full-sized avatar

Jean-Baptiste VIMORT jbvimort

  • Kitwar Inc.
  • Carrborro NC
View GitHub Profile
@jbvimort
jbvimort / gist:903f626b27587a2a137293da0d0cf5e0
Created November 14, 2017 18:53
Slicer-RelWithDebInfo-build
set PATH=C:\cmake-3.9.1\bin;%PATH%
set ROOT=C:\
cd %ROOT%
cd S-rwdi
set Qt5_DIR=C:\Qt\5.9.1\msvc2015_64\lib\cmake\Qt5
import itk, sys
if len(sys.argv) != 7:
print("Usage: " + sys.argv[0] + " <inputImagePath> <maskImagePath>"
" <NumberOfBinsPerAxis> <PixelValueMin> "
"<PixelValueMax> <NeighborhoodRadius>")
sys.exit(1)
im = itk.imread(sys.argv[1])
maskReader = itk.ImageFileReader.IUC3.New()
import os
import csv
import re
dataDir = "/home/jean-baptiste/Documents/4Neighborhood/CSVfeatureMaps/"
with open('trainingData.csv', 'w') as csvWritefile:
fieldnames = ['ID', 'Energy', 'Entropy', 'Correlation', 'InverseDifferenceMoment','Inertia', 'ClusterShade',
'ClusterProminence', 'HarralickCorrelation','ShortRunEmphasis', 'LongRunEmpasis','GreyLevelNonUniformity',
'RunLengthNonUniformity','LowGreyLevelRunEmphasis', 'HighGreyLevelRunEmphasis',
'ShortRunLowGreyLevelEmphasis', 'ShortRunHighGreyLevelEmphasis','LongRunLowGreyLevelEmphasis', 'LongRunHighGreyLevelEmphasis']
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
class dumyExtenction(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/ScriptedLoadableModule.py
"""
def __init__(self, parent):
ScriptedLoadableModule.__init__(self, parent)
import os
import unittest
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import json
#
# dumyExtenction
#
import os
import unittest
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import json
#
# dataStructureExemple
#
{
"fiducials":{
"IDofFiducial1":{
"midpoint":{
"IsAMidPoint":false,
"points":null
},
"projection":{
"isProjected":true,
"indexClosestPoint":32