Skip to content

Instantly share code, notes, and snippets.

View fedorov's full-sized avatar
🇺🇦
Времена не выбирают, в них живут и умирают. - Александр Кушнер

Andrey Fedorov fedorov

🇺🇦
Времена не выбирают, в них живут и умирают. - Александр Кушнер
View GitHub Profile
#!/usr/bin/python
#
# Delete the label image from an Aperio SVS file.
#
# Copyright (c) 2012-2013 Carnegie Mellon University
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, version 2.1.
@fedorov
fedorov / adcdcmChecks.py
Created August 17, 2016 18:28
Python script to complete DICOM checks using dciodvfy. To use, install pydicom dependency and run from the directory containing "ADC DICOM challenge" data (from Dariya).
import dicom, sys, os, subprocess, re
typesMap = {}
for sd, d, fs in os.walk("."):
for f in fs:
fpath = os.path.join(sd,f)
try:
dcm = dicom.read_file(fpath)
location = fpath.split('/')[1]
@fedorov
fedorov / dcmqi-seg.jsonld
Created May 6, 2016 20:32
Experiment to use JSON-LD for communicating metadata to dcmqi conversion tools http://github.com/qiicr/dcmqi
{
"@context": {
"ClinicalTrialSeriesID" : "http://dicom.nema.org/medical/dicom/current/output/chtml/part06/chapter_6.html#para_87c4e314-1f60-49f3-a379-5f6926316ec0",
"ContentCreatorName" : "http://dicom.nema.org/medical/dicom/current/output/chtml/part06/chapter_6.html#para_1d93f33c-3935-49db-97c0-2dcad981f4aa",
"ReaderID" : "ContentCreatorName",
"SessionID" : "ClinicalTrialSeriesID",
"ClinicalTrialTimePointID" : "http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.2.3.html#para_4d2ee376-92b4-4f23-9560-4fd0f5af77ad",
"TimePoint" : "ClinicalTrialTimePointID",
"SeriesDescription" : "http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.3.html#para_5fe2ee7d-82fc-44e4-893b-eecb8eb89550",
"SeriesNumber" : "http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.8.html#para_cf392e6c-ab22-41a7-90ce-cf16145dc849",
General Registration (BRAINS) standard output:
Original Fixed image origin[-71.857, -97.5889, 15.724, 0]
TranformTypes: Rigid(1 of 1).
Initializing transform with useCenterOfROIAlign
Initializing transform with useCenterOfROIAlign to
VersorRigid3DTransform (0x104ab77c0)
RTTI typeinfo: itk::VersorRigid3DTransform<double>
Reference Count: 2
General Registration (BRAINS) standard output:
Original Fixed image origin[-71.857, -97.5889, 15.724, 0]
TranformTypes: Rigid(1 of 3).
TranformTypes: Affine(2 of 3).
TranformTypes: BSpline(3 of 3).
Initializing transform with useCenterOfROIAlign
Type: Information
Time: Tue Mar 22 17:00:11 2016
Description: BRAINSFitIGT completed without errors
Type: Information
Time: Tue Mar 22 17:00:10 2016
Description: BRAINSFitIGT standard output:
TranformTypes: Rigid(1 of 2).
@fedorov
fedorov / gist:4f69f0f19da3c2ff0db1
Created October 21, 2015 01:51
urlopen CERTIFICATE_VERIFY_FAILED error
import TCIABrowserLib
c=TCIABrowserLib.TCIAClient(baseUrl='https://services.cancerimagingarchive.net/services/TCIA/TCIA/query')
c.get_collection_values()
@fedorov
fedorov / Config file passed to fCal and Slicer
Created June 16, 2015 13:47
BWH - debugging Plus low FPS for prostate data acquisition
<PlusConfiguration version="2.3" PlusRevision="Plus-2.1.0.3427">
<DataCollection StartupDelaySec="1">
<DeviceSet Name="BK8818E depth 5.3cm w Slicer post calibration Q" Description="Epiphan frame grabber with Ascension EM trackers. Sensors in order: Red (111), Green (222), Blue (unmarked)."/>
<Device
Id="TrackerDevice"
Type="Ascension3DG"
AcquisitionRate="50"
LocalTimeOffsetSec="0.15"
FilterAcWideNotch="1"
FilterAcNarrowNotch="0"
@fedorov
fedorov / gist:67ac50a226b56ed12ae7
Created June 16, 2015 13:36
Plus capture config file - debug low FPS
<PlusConfiguration version="2.3" PlusRevision="Plus-2.2.0.4177 - Win32">
<DataCollection StartupDelaySec="1">
<DeviceSet Name="BK8818E depth 5.3cm w Slicer post calibration Q" Description="Epiphan frame grabber with Ascension EM trackers. Sensors in order: Red (111), Green (222), Blue (unmarked)." />
<Device
Id="TrackerDevice"
Type="Ascension3DG"
AcquisitionRate="50"
LocalTimeOffsetSec="0.15"
FilterAcWideNotch="1"
FilterAcNarrowNotch="0"
@fedorov
fedorov / gist:ef8ac0dcd787e3555b80
Created June 16, 2015 13:35
Plus capture header file recorded from Slicer PlusRemote
ObjectType = Image
NDims = 3
AnatomicalOrientation = RAI
BinaryData = True
BinaryDataByteOrderMSB = False
CenterOfRotation = 0 0 0
CompressedData = False
DimSize = 1280 1024 244
ElementNumberOfChannels = 1
ElementSpacing = 1 1 1