This file contains 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
I: Requesting Association | |
I: Association Accepted | |
Association successful | |
I: Sending Echo Request: MsgID 1 | |
I: Releasing Association | |
I: Association Aborted | |
D: Request Parameters: | |
D: ======================= OUTGOING A-ASSOCIATE-RQ PDU ======================== | |
D: Our Implementation Class UID: 1.2.826.0.1.3680043.9.3811.2.0.2 | |
D: Our Implementation Version Name: PYNETDICOM_202 |
This file contains 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
import numpy as np | |
import slicer, vtk | |
def getVolumeCoordinateTransformMatrixDict(volNode): | |
import numpy as np | |
def translationMatrix(point): | |
trMat = np.eye(4) | |
trMat[0:3, 3] = (*point,) |
This file contains 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
class SomeModuleLogic(ScriptedLoadableModuleLogic): | |
def exportRedSliceAsDicom(self, patientNameSH, xRangeMm=150, yRangeMm=150, zRangeMm=0.5, outputFolderPath=None, dicomTagDict=None): | |
""" This function creates an ROI centered on the center of the Red slice view, and | |
with axes aligned with that slice view's slice, and with thickness specified by zRangeMm. | |
This ROI is then used to crop the red slice's current background image volume to slices | |
in this orientation (I choose the zRange such that this results in a single slice by | |
setting it to close to the minimum voxel side length), and export the result to DICOM. | |
In order to export to DICOM, a patient and study need to be created in the subject hierarchy, | |
these are done the subject name given in patientNameSH and with study name "SingleSliceExport". |
This file contains 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
import os | |
import unittest | |
import logging | |
import vtk, qt, ctk, slicer | |
import numpy as np | |
from slicer.ScriptedLoadableModule import * | |
from slicer.util import VTKObservationMixin | |
# | |
# StitchVolumes |
This file contains 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
import logging | |
import os | |
import unittest | |
import vtk, qt, ctk, slicer | |
import SegmentStatistics | |
from slicer.ScriptedLoadableModule import * | |
from slicer.util import TESTING_DATA_URL | |
from slicer.util import VTKObservationMixin | |
This file contains 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
import logging | |
import os | |
import unittest | |
import vtk, qt, ctk, slicer | |
import SegmentStatistics | |
from slicer.ScriptedLoadableModule import * | |
from slicer.util import TESTING_DATA_URL | |
from slicer.util import VTKObservationMixin | |
This file contains 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
def shiftVolumeRendering(volumePropertyNode, xOffset=0): | |
""" Shift the scalar opacity control point values by an | |
offset value (similar to moving the "Shift" slider in the volume rendering module) | |
""" | |
volProp = volumePropertyNode.GetVolumeProperty() | |
scalarOpacity = volProp.GetScalarOpacity() # this is a vtkPiecewiseFunction | |
pointIdx = 0 | |
opacityPointValues = [] # list to hold values | |
# Gather Existing Values | |
for pointIdx in range( scalarOpacity.GetSize() ): |
This file contains 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
import os | |
import unittest | |
import logging | |
import vtk, qt, ctk, slicer | |
from slicer.ScriptedLoadableModule import * | |
from slicer.util import VTKObservationMixin | |
# | |
# AutoCompleteCrash | |
# |