This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sstream> | |
#include <algorithm> | |
// Utility methods to be able to convert between various anatomical coordinate systems | |
namespace vtkAnatomicalOrientation { | |
enum class Axis { L, R, P, A, S, I, None }; | |
static const Axis ValidAxes[6] = { Axis::L, Axis::R, Axis::P, Axis::A, Axis::S, Axis::I }; | |
static std::string AxisToString(Axis axis) { | |
switch (axis) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[filter "lfs"] | |
clean = git-lfs clean -- %f | |
smudge = git-lfs smudge -- %f | |
process = git-lfs filter-process | |
required = true | |
[alias] | |
graph = log --graph --decorate --color --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | |
lg = graph --first-parent | |
merges = lg --merges | |
amend = commit --amend --no-edit --signoff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
domain=$1 | |
echo -ne "Looking up $domain DNS: " | |
while true; do | |
nslookup $domain | grep -q "find" | |
retVal=$? | |
if [ $retVal -ne 0 ]; then | |
ip=$( nslookup $domain | awk -F': ' 'NR==6 { print $2 } ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in iMSTK | |
auto vegaMesh = MeshIO::read("/Users/agirault/Downloads/mandible.veg"); | |
auto writeStatus = MeshIO::write(vegaMesh, "/Users/agirault/Downloads/mandible.vtu"); | |
std::cout << writeStatus << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------------------------------------------------- | |
void qMRMLSubjectHierarchyTreeView::updateItemsSelectableFlag() | |
{ | |
Q_D(qMRMLSubjectHierarchyTreeView); | |
if (!d->SubjectHierarchyNode) | |
{ | |
return; | |
} | |
qMRMLSubjectHierarchyModel* sceneModel = qobject_cast<qMRMLSubjectHierarchyModel*>(this->model()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto picker = vtkSmartPointer<vtkPropPicker>::New(); | |
picker->Pick(screen_x, screen_y, 0, renderer); | |
// Check if pick is in bounds | |
vtkAssemblyPath* path = picker->GetPath(); | |
bool validPick = false; | |
if (path) { | |
vtkCollectionSimpleIterator sit; | |
path->InitTraversal(sit); | |
vtkAssemblyNode *node; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git status with a dirty flag | |
function __git_status_flag { | |
git_status="$(git status 2> /dev/null)" | |
clean_pattern="working tree clean" # For macOS. For Linux: "working directory clean" | |
remote_pattern="Your branch is (.*)" | |
diverge_pattern="Your branch and (.*) have diverged" | |
if [[ ! ${git_status} =~ ${clean_pattern} ]]; then | |
state="⚡ " | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const char* objPath = ""; //orientation cube | |
const char* jpgPath = ""; //orientation texture | |
vtkRenderWindow* renderWindow = self.vtkView.renderWindow; | |
// Create & add the renderer | |
renderer = vtkSmartPointer<vtkRenderer>::New(); | |
renderer->SetBackground(0., 0., 0.); | |
renderer->SetViewport(0., 0., 1., 1.); | |
renderer->InteractiveOn(); | |
renderWindow->AddRenderer(renderer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Directory | |
const char *folderASCII = [folder cStringUsingEncoding:NSASCIIStringEncoding]; | |
auto dicomDir = vtkSmartPointer<vtkDICOMDirectory>::New(); | |
dicomDir->SetDirectoryName(folderASCII); | |
dicomDir->Update(); | |
// Reader | |
auto reader = vtkSmartPointer<vtkDICOMReader>::New(); | |
reader->SetFileNames(dicomDir->GetFileNamesForSeries(0)); | |
//reader->SetMemoryRowOrderToFileNative(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------------- | |
void vtkOpenGLVertexBufferObject::AddDataArray(vtkDataArray *data) | |
{ | |
if (!this->VertexCount) | |
{ | |
this->VertexCount = data->GetNumberOfTuples(); | |
} | |
else if (VertexCount != data->GetNumberOfTuples()) | |
{ | |
vtkErrorMacro("AddDataArray() can not add array with a different number of " |