Skip to content

Instantly share code, notes, and snippets.

View igoroctaviano's full-sized avatar
🏠
Working from home

Igor Octaviano igoroctaviano

🏠
Working from home
View GitHub Profile
@igoroctaviano
igoroctaviano / sort_dicom_dir.py
Created September 15, 2023 12:52
Sort DICOM files
import os
import pydicom # pydicom is using the gdcm package for decompression
def clean_text(string):
# clean and standardize text descriptions, which makes searching files easier
forbidden_symbols = ["*", ".", ",", "\"", "\\", "/", "|", "[", "]", ":", ";", " "]
for symbol in forbidden_symbols:
string = string.replace(symbol, "-") # replace everything with an dash (safer) or underscore
return string.lower()
@igoroctaviano
igoroctaviano / pull_request_template.md
Last active September 6, 2023 14:27
pull_request_template.md

Context

Ticket number:

Please, don't forget to add it (this will make your life MUCH easier)

Checklist

  • Monday's ticket number referenced
  • Brief description of changes
@igoroctaviano
igoroctaviano / rt-json.json
Created January 25, 2022 22:48
RT JSON example
{
"studies": [
{
"StudyInstanceUID": "1.2.840.113704.1.111.6364.1415112213.5",
"StudyDescription": "RT 6TH RIB",
"StudyDate": "20141104",
"StudyTime": "135936",
"PatientName": "TEST, TEST",
"PatientID": "123456789",
"AccessionNumber": "",
@igoroctaviano
igoroctaviano / dicomweb-client-searchForSeries-response-example.json
Created August 27, 2021 21:38
This is how to parse a DICOM binary to the dicomweb-client's format using dcmjs.
import dcmjs from 'dcmjs';
const { data } = dcmjs;
const { DicomMessage, DicomMetaDictionary } = data;
const arrayBufferOfDICOM = /** Your DICOM file binary */
const dicomDataInTheCorrectResponseFormat = DicomMessage.readFile(arrayBufferOfDICOM).dict;
const dicomDataInANaturalizedFormat = DicomMetaDictionary.naturalizeDataset(dicomDataInTheCorrectResponseFormat);
@igoroctaviano
igoroctaviano / dicomweb-client-retrieveSeriesMetadata-response-example.json
Last active August 27, 2021 21:33
This is an example of the response of the dicomweb-client's request "retrieveSeriesMetadata" which return all sop instances metadata of a given series instance uid of a study. The representation is JSON and the return is an array that is composed of individual sop instance metadata (without pixel data) in raw DICOM tag format.
[
{
"00080005": {
"vr": "CS",
"Value": ["ISO_IR 100"]
},
"00080008": {
"vr": "CS",
"Value": ["ORIGINAL", "PRIMARY", "LOCALIZER"]
},
@igoroctaviano
igoroctaviano / dicomweb-client-searchForSeries-response-example.json
Last active August 27, 2021 21:30
This is an example of the response of the dicomweb-client's request "searchForSeries" which return all series metadata of that study. The representation is JSON and the return is an array that is composed of individual series metadata (without sop instances) in raw tag format.
[
{
"00080005": {
"vr": "CS",
"Value": ["ISO_IR 100"]
},
"00080054": {
"vr": "AE",
"Value": ["DCM4CHEE"]
},
@igoroctaviano
igoroctaviano / something.js
Created July 24, 2018 15:12
A Web History
let something = (() => {
// so called "encapsulation" here
// ...
// and then...
return {
firstPublic: ...,
second public: ...
};
}) ();
@igoroctaviano
igoroctaviano / bundle.js
Created July 24, 2018 15:11
A Web History
{
1: ...,
2:[
function (require, module, exports) {
const XHR = require ('../ lib / xhr.js');
const DOM = require ('../ lib / domUtils.js');
function loader {container} {
const output = DOM.printTo (container);
@igoroctaviano
igoroctaviano / myShirt.js
Created July 24, 2018 15:10
A Web History
// myShirt.js now have dependencies, the shopping cart and the inventory
// module in the same directory as myShirt.js
define (["./ cart", "./inventory"], (cart, inventory) => {
// returns an object to define the module "myShirt".
return {
color: "blue",
size: "large",
addToCart: () => {
inventory.remove(this);
cart.add(this);
@igoroctaviano
igoroctaviano / example.js
Created July 24, 2018 15:09
A Web History
// request dependency:
let a = require ('a.js'); // Node.js modules
import a from 'a.js'; // ES modules
// ... your code here ...
// a way to turn the things visible outside the module:
module.exports = something; // Node.js
export something;