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 <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
int main(void) { | |
size_t *s; | |
double *d; | |
int *i; |
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
from math import log10 | |
from math import floor | |
def pretty(x, min_digits=4, exponent=2): | |
""" | |
A nicer way to print floats than the {:g} format. | |
min_digits: the minimum number of significant digits which will be printed. |
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
import sys | |
import logging | |
import argparse | |
logger = logging.getLogger(__name__) | |
def main(args=sys.argv[1:]): | |
""" Main function for trip2dicom.py | |
""" |
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
# Example of how to load DICOM data using PyTRiP | |
# lots of DICOM may be found at SlicerRT | |
# https://github.com/SlicerRt/SlicerRtData | |
import pytrip as pt | |
dp = "/local/dicom/pinnacle3-9.9-phantom-imrt/" | |
dcm = pt.dicomhelper.read_dicom_dir(dp) |
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 <stdio.h> | |
#include <stdlib.h> | |
/* gcc test_ppstruct.c -o test_ppstruct -Wall */ | |
struct point { | |
double x; | |
double y; | |
}; |
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
""" | |
Reworked code based on | |
http://trevorius.com/scrapbook/uncategorized/pyqt-custom-abstractitemmodel/ | |
Adapted to Qt5 and fixed column/row bug. | |
TODO: handle changing data. | |
""" | |
import sys |
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
### Keybase proof | |
I hereby claim: | |
* I am nbassler on github. | |
* I am unabdingbar (https://keybase.io/unabdingbar) on keybase. | |
* I have a public key ASCiRk0ACJmOXLBynm9X7T0gONnCZJIvtqWa3G41RoEiWgo | |
To claim this, I am signing this object: |
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
How to rebase: | |
go to branch to be rebased | |
$ git rebase master | |
in case of conflict, fix/edit the file | |
$ git add file | |
$ git rebase --continue | |
repeat until nothing more to be applied. | |
git push feature/111-mybranch --force |
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
# first line below is necessary only in wxPython 2.8.11.0 since default | |
# API in this wxPython is pubsub version 1 (expect later versions | |
# of wxPython to use the kwargs API by default) | |
from wx.lib.pubsub import setupkwargs | |
# regular pubsub import | |
from wx.lib.pubsub import pub | |
class SomeReceiver(object): | |
def __init__(self): |
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
import pytrip as pt | |
#dcmf = "/local/dicom/pinnacle3-9.9-phantom-imrt" | |
dcmf = "/local/dicom/xio-4.33.02-phantom-chest/" | |
dcm = pt.dicomhelper.read_dicom_folder(dcmf) | |
dcmf2 = "chestdcm" | |
dcm2 = pt.dicomhelper.read_dicom_folder(dcmf2) | |
c1 = dcm['images'] |
NewerOlder