Google PhotoScan pour numériser vos anciennes photos

Avec l’application Google PhotoScan, les photos du passé rencontrent le scanner du futur.

Pour numériser des anciennes photos de famille dans le passé, il fallait utiliser un scanner de bureau et un logicel de retouche photo pour recadrer les résultats et, le cas échéant, pour corriger des défauts. Si les photos étaient collées dans un album, le recours à un scanner plat était onéreux ou même impossible. Il restait la possibilité de reproduire les anciennes photos avec sa caméra ou son mobilophone. Dans ces cas on devait également utiliser un logiciel de retouche pour éliminer des reflets éventuels et pour corriger la perspective, suite à l’inclinaison inévitable de l’appareil photo ou du mobilophone. Dans tous les cas la procédure était lourde et prenait beaucoup de temps.

Fin 2016, Google présentait son application PhotoScan pour smartphone et tablette, permettant de numériser en un temps record toutes ses anciennes photos. Cette application intelligente ne nécessite que peu de travail, les algorithmes de Google se chargent de gommer automatiquement les défauts des photos argentiques et de redonner des couleurs vives pour disposer d’une version numérique et propre des clichés, sans aucun reflet.

La version actuelle de PhotoScan est 1.5, elle a été publiée le 14 décembre 2017. Cette app est disponible dans le PlayStore pour Android et dans l’AppStore pour iOS.

En l’absence de reflets indésirables sur les photos à reproduire, la procédure est simple et rapide. On démarre l’application PhotoScan sur son mobilophone (ou tablette), on désactive la fonctionnalité de suppression des reflets et on pousse sur le bouton rond.

PhotoScan

Numériser une ancienne photo avec PhotoScan est simple comme Bonjour

Les photos numérisées sont enregistrées sur votre appareil lors de la numérisation. Le recadrage se fait automatiquement, avec détection des bords. La photo résultante est droite et rectangulaire, avec correction de la perspective. Il y a en outre un outil intégré, avec loupe, pour faire glisser les bords et les coins aux fins d’ajuster le recadrage automatique de la photo numérisée, le cas échéant. Une rotation intelligente est également assurée et les photos restent dans le bon sens, quelle que soit leur orientation au moment de la numérisation.

La dimension la plus large des photos numérisées avec Google Scan sur iPhone X est de 4.096 pixels. Chaque photo est enregistrée en deux exemplaires : la photo telle que vue sur l’écran au début de la numérisation et la photo reconstituée. Le nom du fichier d’une photo numérisée est défini au hasard avec une séquence de quatre lettres majuscules et de quatre chiffres, par exemple RZMM2336.JPG ou MQLB9372.JPG. Une lettre E est ajoutée au milieu du nom du fichier pour les photos reconstituées (RZMME2336.JPG et MQLBE9372.JPG.)

Les images qui suivent montrent la qualité d’anciennes photos numérisées avec GoogleScan.

GoogleScan

A gauche la photo dans l’album telle qu’elle est affichée sur l’écran du mobile. A droite la photo résultante de la numérisation intelligente, en haute résolution, avec recadrage, rotation et correction automatique.

GoogleScan

En haut la photo dans l’album telle qu’elle est affichée sur l’écran du mobile. En bas la photo résultante de la numérisation intelligente, en haute résolution, avec recadrage et correction automatique.

Sur les images qui suivent, la qualité des photos numérisées avec Google Scan peut être comparée avec des photos digitalisées moyennant un scanner de bureau standard.

scan comparison

Les photos en haut ont été numérisées avec un scanner de bureau. Les photos en bas ont été numérisées avec GoogleScan sur iPhone X.

scan comparison

La photo à gauche a été numérisée avec un scanner de bureau. La photo à droite a été numérisée avec GoogleScan sur iPhone X.

Si la photo à reproduire présente des reflets à cause d’une lumière directe ou indirecte, la procédure est un peu plus longue, mais également très simple d’utilisation. L’application nous indique quoi faire. La marche à suivre est basique : il faut placer son image dans le cadre, prendre la photo, déplacer ensuite son smartphone (sans incliner l’appareil) tout en visant les quatre points situés à chaque coin de l’image. Grâce aux quatre clichés complémentaires prises, GoogleScan supprimer les reflets habituels d’une photo imprimée sur papier brillant et produit une photo numérisée avec une meilleure qualité.

PhotoScan Mariage

Pour éliminer les reflets sur la photo ancienne, il faut bouger l’applareil (si possible sans inclinaison) pour faire passer le cercle ouvert au mileu sur les quatre cercles blancs dans les coins de la photo. Les quatres clichés additionnelles sont pris automatiquement en cas d’accord.

L’application PhotoScan permet de sauvegarder aisément les photos numérisées sur la plateforme Google Photos pour les stocker en lieu sûr, les rechercher et les organiser. Sur cette plateforme on peut animer les photos, appliquer des filtres, faire des retouches avancées et envoyer des liens aux amis et membres de la famille pour partager les photos favoris.

GAFAM AI

La présente contribution est la suite de mon article récent Le web intelligent. AI est l’abbréviation de Artificial Intelligence, GAFAM est l’acronyme de Google, Apple, Facebook, Amazon et Microsoft. On appele ces cinq entreprises les géants du Web.

Dans l’article précité, on a passé en revue les produits commerciaux d’intelligence artificielle de Google et Amazon. Abstraction faite de Siri, Apple n’a pas encore lancé ses propres services AI pour le public, mais l’entreprise a publié sa première publication scientifique sur l’intelligence artificielle le 22 décembre 2016 (Learning from Simulated and Unsupervised Images through Adversarial Training).

Facebook publie depuis quelques années déjà des articles scientifiques sur l’intelligence artificielle et dispose de son propre site web Facebook Research. Parmi les activités de recherche on trouve Applied Machine Learning, Computer Vision, Data Science, Human Computer Interaction & UX, Natural Language Processing & Speech, Facebook AI Research (FAIR). Facebook n’offre pas encore de services AI en ligne, mais quelques logiciels qui accompagnent ses publications scientifiques sont disponibles en téléchargement sur son site web de recherche.

Parmi les entreprises GAFAM, Microsoft est le pionnier de la recherche technologique. Avec plus de 10.000 publications scientifiques et plus de 800 chercheurs internes dans ses laboratoires, Microsoft est le “leader” incontesté des services d’intelligence artificielle, appelés Microsoft Cognitive Services.

Microsoft a démarré ses services AI en 2015 et présente actuellement une panoplie impressionnante de produits commerciaux afférents. Rien que dans le domaine de la vision, les cinq services en ligne suivants sont à la disposition des développeurs:

Nous allons tester les trois premiers services avec les mêmes photos que celles utilisées pour les tests de Google Cloud Vision et Amazon Rekognition.

Microsoft Computer Vision

Parmi les données fournies par le service Computer Vision, les informations principales sont:

  • une description succincte de la photo
  • des étiquettes (tags) concernant le contenu
  • une catégorie
  • le sexe et l’âge des personnes

tags: indoor, child, baby, sitting, boy, young, toddler, room, high

Au sujet de la photo de Charles et Capucine ci-dessus, la description fournie est “a ltitle boy eating a piece of cake”. La catégorie est “others”, le sexe et l’âge (male et 0 ans pour Charles, female et 3 ans pour Capucine) sont indiqués correctement. Les étiquettes attribuées à la photo sont toutes correctes. Une meilleure description serait toutefois: “a baby boy and a toddler girl are eating a piece of cake”.

En ce qui concerne la photo ci-dessous, la description “person sitting on a bench in a park” est fausse. Le sexe (female) de Charles est également faux, l’âge (1 an), les étiquettes et la catégorie (outdoor) sont correctes.

tags: outdoor, ground, tree, grass, park, way, sidewalk

La prochaine photo s’appelle “a little girl sitting at a table with a cake”. La petite fille est en réalité le petit garçon Charles. Google Vision et Amazon Rekognition avaient le même problème de reconnaître les jouets. La catégorie (people-young) et les étiquettes sont OK. Le visage n’est pas reconnu par l’algorithme de Microsoft, ce qui explique l’absence des informations au sujet du sexe et de l’âge.

tags: table, person, indoor, child, little

La première photo de Thomas ci-après est décrite comme “a baby sitting in front of a cake”. Décidément le service Computer Vision de Microsoft favorise les gâteaux. Rien  à critiquer au sujet du sexe (male), âge (0 ans), catégorie (people-young) et étiquettes. Même la fenêtre à l’arrière-plan est reconnue correctement.

tags: person, indoor, sitting, baby, window, orange, high

La prochaine photo est intitulée “a baby sitting on a table”. Catégorie (people-young), sexe (male), âge (1 an) et étiquettes sont également correctes, abstraction faite du tag “cabinet” qui n’est pas approprié.

tags: cabinet, indoor, person, table, sitting, boy, little, baby, orange, toddler

La dernière photo de Thomas ci-après s’énonce “a young boy laying in the snow”. La catégorie est “people”, l’âge (2 ans) est correcte. Ce qui n’est pas cohérent, c’est l’indication du sexe féminin pour une personne libellée comme petit garçon.  Ce qui dérange en outre, c’est l’étiquette “bed”.

tags: snow, person, outdoor, little, boy, child, yound, laying, bed, toddler

Malgré les quelques erreurs et incohérences, il semble que l’application Computer Vision de Microsoft soit plus performante que Google Vision et Amazon Rekognition.

Microsoft Emotion

Contrairement aux services AI de Google et Amazon, Microsoft propose un service spécifique pour la reconnaissance des émotions dans les visages.

emotions: neutral, neutral

Je partage les avis de “visage neutre” pour Charles et Capucine sur la photo ci-dessus et de “joie” sur le visage de Charles sur la photo ci-dessous.

emotion: happiness

La troisième photo de Charles, où le visage n’est pas reconnu, n’est pas affichée dans l’application “Emotion” de Microsoft.

visage non détecté

emotion: neutral

Sur la photo en haut Thomas affiche effectivement un visage “neutre”, tandis que sur la photo en bas on décèle une légère surprise.

emotions: neutral, surprise

Microsoft Computer Vision est le seul service qui interprète correctement l’émotion de Thomas sur la photo qui suit:”sadness”.

emtion: sadness

Microsoft Face

La comparaison de visages est également un service spécifique dans la famille des produits AI de Microsoft. La comparaison des jumeaux Charles et Thomas est difficile pour les humains et on pardonne à l’application Computer Vision de prétendre que les deux personnes sont identiques, avec une très grande certitude.

Charles et Thomas : même personne

On pardonne moins que Computer Vision nous dit que Capucine et Charles sont la même personne, même s’il y a une petite ressemblance.

Capucine et Charles: même personne

C’est toutefois incompréhensible que Charles et Astor sont identifiés comme les mêmes personnes,

Charles et Astor: même personne

tandis que Capucine qui souffle des bougies sur un gâteau n’est pas reconnue comme Capucine.

Capucine et Capucine: personnes différentes

Marco n’est pas reconnu non plus comme même personne sur deux photos ayant un écart d’âge de 40 ans. Décidément le service “Microsoft Face” doit encore faire beaucoup de séances de “deep learning” pour se perfectionner. Heureusement les outils afférents pour parfaire la reconnaissance des visages fait partie du service en ligne “Face” de Microsoft.

Marco et Marco: 40 ans d’écart > personnes différentes

Google Vision n’offre pas encore un service public de reconnaissance des visages. Si on compare l’application Microsoft Face avec le service de reconnaissance faciale d’Amazon, il faut dire que ce dernier a plusieurs longueurs d’avance. Les services Microsoft Cognition offrent toutefois des options de “training” pour parfaire la reconnaissance des visages, ce qui manque encore pour Amazon Rekognition.

Le web intelligent

Dernière mise à jour: 19 mars 2017

Chronologie Internet

Il y a presque 4 ans, j’avais publié sur mon blog une proposition de diviser la chronologie du web (timeline) en neuf époques. J’avais opté pour le nom de web intelligent (web 3.5) pour caractériser la période de début 2015 à mi 2017.

Pour moi, le web intelligent a les compétences suivantes:

  • il parle notre langue
  • il lit notre écriture
  • il comprend notre langage et reconnaît notre voix
  • il reconnaît notre visage et décode nos émotions
  • il interprète des images et scènes vidéo
  • il a des connaissances vastes sur tous les sujets
  • il prend des décisions autonomes
  • il est capable d’apprendre afin de parfaire ses compétences

Les technologies qui sont à la base de ces compétences existent depuis des années, voire des décennies. Ils ont fait l’objet de recherches, de  tests, de prototypes, d’applications innovantes et de produits commerciaux, mais le plus souvent d’une façon isolée, pour une seule compétence.

Le GPS nous parle dans la voiture, Siri et Alexa répondent à nos questions sur le mobile, Google Photo et Facebook reconnaissent les visages sur nos photos, Wikipedia sait tout (ou presque), des outils d’aide à la décision sont omniprésents et les réseaux neuraux permettent aux machines d’apprendre en profondeur (deep learning).

Ce qui a changé en 2016, c’est le fait que toutes ces technologies ont été assemblées par Google et par Amazon Web Services (AWS) dans des produits commerciaux d’intelligence artificielle qui sont maintenant à la disposition des développeurs du monde entier.

Le web 3.5 est donc devenu réalité.

Google Cloud Platform

Google est bien connu pour son moteur de recherche, sa plateforme vidéo Youtube et ses services de traduction. Depuis 2011, Google offre aux programmeurs et sociétés d’héberger leurs propres applications sur la même infrastructure que celle qu’elle utilise en interne. Ce service est appelé Google Cloud Platform et se compose d’une famille de produits, chacun comportant une interface web, un outil de lignes de commande, et une interface de programmation applicative REST. Parmi ces produits on distingue:

  • Google App Engine
  • Google Storage
  • Goggle Compute Engine
  • Google Translate

L’ensemble des produits et services est décrit sur la page web cloud.google.com.

En mars 2016, Google a annoncé le lancement de la famille Cloud Machine Learning service mainstream. Les services suivants font partie, entre autres, de cette famille:

  • Cloud ML : Large Scale Machine Learning Service
  • Cloud Natural Language API : Powerful Text Analysis
  • Cloud Speech API : Powerful Speech Recognition in 80 languages
  • Cloud Translate API : Fast, Dynamic Translation
  • Cloud Vision API : Powerful Image Analysis

Google Cloud Vision

De prime abord, je me suis intéressé pour le nouveau service Cloud Vision. Dans le passé j’avais déjà effectué des tests avec différentes applications de reconnaissance faciale et de lecture de textes. Les contributions afférentes sont disponibles sur mon blog.

Pour faire des tests, j’ai pris au hasard quelques photos de mes petits-enfants.

Les résultats de Google Vision sont affichés dans plusieurs onglets:

  • Faces : reconnaissance de visages et d’émotions
  • Labels : reconnaissance de scènes et d’objets
  • Text : lecture de caractères et de textes
  • Colors : classification des couleurs dominantes
  • Safe Search : contenus avec nudité, violence, haine ou sujets médicaux
  • JSON Response : ensemble détaillé des données en format JSON

Les résultats ont été assemblés dans une seule image, par copie-collage, pour donner une meilleure vue globale.

Google Vision ne fournit pas un service de reconnaissance des personnes comme dans Google Photo, mais se limite à détecter les visages et à interpréter les émotions. Dans la figure ci-dessus les informations pour les deux visages sont indiquées en haut à droite (Charles) et en bas à gauche (Capucine). Les étiquettes (label)  pour la scène sont affichées en bas au milieu, le texte reconnu se trouve en bas à droite.

Les termes reconnus “Carla” et “Charlie” sont les noms de vaches qui figurent sur la nappe de la table, comme on peut le voir sur l’agrandissement ci-dessous.

Un exemple de l’onglet “JSON Response” est présenté ci-après. Tous les détails de l’analyse sont fournis dans cette structure JSON.

En ce qui concerne l’analyse proprement dite, Google Vision ne détecte pas d’émotions sur les visages des deux enfants, sauf une légère surprise sur le visage de Charles. Hormis la reconnaissance de personnes (toddler, child),  Il n’y a guère d’informations sur le contexte.

Pour les images suivantes, seuls les résultats “Faces” et “Labels” sont présentés dans les figures montées.
 Google Vision voit de la joie dans le visage de Charles qui se trouve dehors, dans une sorte de jardin, avec des feuilles, en automne. Bonne interprétation.
 Google Vision estime que Charles fête son anniversaire à Noël. En réalité il joue en février 2016 avec du Lego. Echec.
L’activity-Center Fisher-Prize de Thomas fait penser Google Vision à un anniversaire et à de la nourriture.

Google Vision considère que Thomas est un peu surpris et combine les activités jouer et manger. Bien.

Thomas semble être en colère et se trouve dans la neige, en hiver et il a froid. Analyse correcte.

Amazon Web Services

Tout le monde connaît Amazon en tant que fournisseur en ligne de livres et d’autres objets non périssables, mais peu de personnes savent que Amazon est un des plus grand fournisseurs mondiaux de services informatiques sous le nom de Amazon Web Services (AWS). Tout comme Google, Amazon profite de l’infrastructure nécessaire pour ses propres besoins pour offrir de la capacité et des services à des tiers. Lancé en 2006, AWS se classe aujourd’hui au premier rang des fournisseurs Cloud avec une part de marché de 31%, devant Microsoft (11%) et IBM (7%).

J’utilise les services d’AWS depuis octobre 2008.

Le 30 novembre 2016, Werner Vogels, le CTO (Chief Technological Officer) de Amazon, annonçait sur son blog All Things Distributed le lancement des nouveaux services d’intelligence artificielle (AmazonAI) de AWS.

Amazon AI

Le but d’Amazon AI est d’apporter une intelligence artificielle puissante à tous les développeurs. La gamme des services Amazon AI se compose de:

  • Amazon Lex : concevoir des interfaces conversationnelles ayant recours à la voix et au texte, via les mêmes technologies d’apprentissage approfondi que celles utilisées par Alexa
  • Amazon Rekognition : reconnaissance d’image basée sur l’apprentissage approfondi
  • Amazon Polly : convertir un texte en voix numérique
  • Amazon Machine Learning : un service d’apprentissage automatique évolutif pour les développeurs

Chez Amazon AI, je me suis également intéressé d’abord pour Amazon Rekognition. Du premier coup j’ai vu des ressemblances avec la technologie Orbeus ReKognition que j’avais exploré en 2014. Dans la suite j’ai trouvé sur le net un article de Bloomberg relatant que Amazon a acquis en automne 2015  la startup Orbeus Inc., mais sans en faire une annonce officielle.

Amazon Rekognition ne fournit pas seulement des informations sur les émotions détectées sur les visages, mais également des renseignements sur le sexe et sur des accessoires comme lunettes, barbes, moustaches. Dans la détection des scènes et objets on reçoit en général plus d’étiquettes qu’avec Google Vision. Amazon Rekognition n’offre toutefois pas une reconnaissance intégrée de textes.

Les résultats des tests effectués avec les mêmes six photos de mes petits-enfants sont présentés ci-après. On peut donc les comparer avec ceux fournis par Google Vision.

Charles est identifié comme une fille, ce qui n’est pas correct. Le décor est reconnu correctement comme maison et même le Dudu de Capucine est associé correctement à une courtepointe (quilt, towel).

La scène est considérée comme un labyrinthe, une arène ou un amphithéâtre. Il n’y a pas de notion de nature ou de bois.  Google a fait mieux. Amazon AI est toutefois d’accord avec Google Vision que Charles sourit.

Le système reconnaît des personnes, des jouets, une chaise et un coussin dans un décor de maison. Il confond toutefois des jouets avec de la nourriture. Google Vision n’a pas fait mieux.

Le centre d’activités Fisher-Price de Thomas est identifié comme un gâteau d’anniversaire, ou un dessert, en tout cas quelque chose pour manger. Google Vision a fait les mêmes réflexions.

Dans cette scène, le système détecte correctement qu’il s’agit d’objets pour boire et manger. Thomas, plus âgé que sur la précédente photo, est reconnu maintenant comme un garçon qui ne rit pas, mais qui paraît surpris.

La scène n’est pas reconnue comme activité dans la neige et le système interprète le pleur de Thomas comme un grand sourire. Echec complet.

Amazon Face Comparison

Le service Amazon Rekognition comprend l’application Face Comparison (comparaison faciale) qui est très performante. A partir d’une photo avec un visage de référence, le service Face Comparison fournit des taux de ressemblance des visages qui figurent sur une photo de comparaison. La série des figures ci-dessous montre quelques exemples:

Thomas est reconnu avec une fiabilité de 93%; similitude avec Charles (83%) et Capucine (76%).

Charles n’est pas reconnu, mais il y a similitude de 74,9% avec Thomas et de 55,1% avec Capucine.

Capucine est reconnue avec une fiabilité de 91%. Il n’y a pas de ressemblance avec les autres.

Marco est reconnu avec une fiabilité de 92%. Il n’y a pas de similitude détectée avec les enfants.

Astor, qui ne figure pas sur la photo à droite, ne ressemble à personne sur cette photo

Amazon fournit également un service de reconnaissance faciale. Il s’agit d’un processus d’identification et de vérification de l’identité d’une personne, en recherchant son visage dans un répertoire d’images de visages. Un répertoire d’images de visages est un index de recherche de vecteurs de caractéristiques faciales. AWS offre plusieurs interfaces (API) pour gérer un tel répertoire et pour ajouter ou supprimer des visages de référence dans le répertoire.

En ce temps Google Vision ne supporte pas encore la reconnaissance des visages dans son API public. Il n’y a donc pas moyen de comparer les performances avec Amazon Rekognition.

Dessins de Capucine

Pour pousser Google Vision et Amazon Rekognition aux limites, j’ai soumis deux dessins récents de ma petite-fille Capucine (4 ans et demi) et une des premières ébauches d’écriture de son nom aux deux systèmes.

Dessins et texte de Capucine à l’âge de 4 ans et demi

Les résultats fournis par Google Vision et Amazon Rekognition ont été assemblés chaque fois dans une seule image.

Le dessin du bonhomme est reconnu par Google Vision (résultats au milieu) comme cartoon et oeuvre d’art, tandis que Amazon Rekognition voit une signature ou un insecte. Aucun des deux systèmes reconnaît une figure humaine.
Les visages avec des boucles d’oreille qui ornent le contour de la main de Capucine ne sont pas identifiés comme tels par aucun des systèmes. Ce sont des lignes, des dessins, des formes ou diagrammes. Amazon Rekognition est au moins d’avis qu’il s’agit de l’art.
En ce qui concerne le nom de Capucine, Google Vision estime qu’il s’agit d’un texte, mais n’est pas en mesure de le lire. L’OCR (optical character recognition) ne fait pas encore partie du produit Amazon Rekognition. Ce système détecte toutefois qu’il s’agit de textes, de caractères, d’une signature ou d’un autographe.

Conclusions

Les performances des deux systèmes Google Vision et Amazon Rekognition sont impressionnantes. Globalement Google Vision semble être plus fiable dans ses analyses en comparaison avec Amazon Rekognition, abstraction faite de la reconnaissance faciale d’Amazon qui est unique.

Bien sûr il y a encore un besoin d’amélioration pour les deux systèmes. Les services Machine Learning des deux fournisseurs permettent de mieux adapter la reconnaissance d’objets et de scènes à son propre environnement, en formant les systèmes moyennant un échantillon d’images et de photos d’apprentissage, avec des étiquettes (labels) sélectionnées manuellement et des étiquettes corrigées en cas d’erreur.

Google profite d’ailleurs sur son site de démonstration d’une variante de son système reCAPTCHA pour exclure les robots à l’utilisation de sa plateforme Cloud. Les réponses fournies par les humains sont utilisées pour parfaire Google Vision.

Google CAPTCHA: Completely Automated Public Turing test to tell Computers and Humans Apart

Le loup et les trois cochons

Le loup

Le loup est un animal, mais le terme loup ne correspond pas à un niveau précis de la classification scientifique des espèces. Dans la présente contribution nous nous intéressons au loup dans sa qualité de personnage traditionnel de conte qui apparaît dans plusieurs récits folkloriques.

Parmi les contes les plus anciens les fables d’Esope sont les mieux documentées. Les fables d’Esope relatives au loup sont:

Le loup et le héron

Les fables d’Ésope ont inspiré de nombreux auteurs.

Les contes des frères Grimm (Grimms Märchen) sont un autre exemple de récits qui se focalisent sur le loup:

Lors du bicentenaire de la publication des contes des frères Grimm le 20 décembre 2012,  Google a dédié un doodle en hommage aux auteurs.

Grand méchant loup

Dans les contes, le loup est vu comme un personnage cruel. Il est là pour faire peur et terroriser ses futures proies. En effet, il se régale des enfants égarés, des grands-mères, mais aussi des animaux plus faibles que lui. Les contes renforcent la mauvaise image que le loup colportait à l’époque où ils furent écrits, c’est-à-dire entre le XVIIe siècle et le XIXe siècle. Le loup était vu par l’homme comme un prédateur, qui pouvait s’attaquer à l’homme à n’importe quel moment.

C’est pour ces raisons que les termes Grand-méchant Loup ou Grand Loup ont fait leur apparition il y a plus de 100 ans.

Les trois cochons

Les Trois Petits Cochons est un conte traditionnel européen dont les premières versions imprimées datent de 1840, bien que son origine puisse remonter plus loin. Le conte mets en scène trois jeunes cochons et un loup. Les trois petits cochons veulent vivre leur vie et quittent le foyer familial pour tenter leur chance dans le monde. Le premier petit cochon se construit une maison de paille. Le deuxième petit cochon se construit une maison faite de bois. Le troisième petit cochon se construit une maison de briques et de ciment.

Le grand méchant loup parvient à détruire les maisons des deux premiers petits cochons en soufflant dessus et les dévore. En revanche, il est impuissant contre celle du troisième petit cochon.

Pour le faire sortir de sa maison, le loup lui propose d’aller chercher des navets avec lui. Mais le cochon sort tôt le matin et rentre chez lui avec les navets avant l’arrivée du loup. Le loup retente sa chance et propose au cochon d’aller cueillir des pommes. Le cochon part à nouveau avant l’heure, mais ayant eu du mal à grimper à l’arbre, le loup arrive à son tour. Le cochon lance alors une pomme très loin en proposant au loup de la goûter. Pendant que le loup la ramasse, il se sauve. Le loup persévère et propose au cochon d’aller à la foire. Arrivé le premier à la foire, le cochon achète une baratte. Sur le chemin du retour, il voit venir le loup : il se cache alors dans la baratte et dévale la pente, ce qui fait peur au loup.

Ce dernier retourne à la maison du petit cochon et découvre que c’est le petit cochon qui lui a fait peur. En colère, il décide de rentrer par la cheminée pour dévorer le cochon. Mais il tombe dans une marmite de soupe bouillante et le cochon le mange pour son dîner.

Ce récit a été illustré par Leonard Leslie Brooke, un dessinateur et écrivain anglais (1862 – 1940), dans une édition de 1904 The Story of the Three Little Pigs, qui est disponible sur le site web de Project Gutenberg.

Illustration des trois petits cochons par L. Leslie Brooke

Le récit est devenu célèbre grâce aux Studios Walt Disney qui ont fait des trois petits cochons les héros de courts métrages animés de la série Silly Symphonies.

Silly Symphonies

Les Silly Symphonies sont une série de courts métrages animés produits entre 1929 et 1939 par les studios Disney. Quelques personnages récurrents dans cette série sont les Trois Petits Cochons.  C’est d’ailleurs le nom du premier court métrage d’animation (Three Little Pigs) de ces personnages, produit par les studios Disney en 1933. Il est basé sur le conte folklorique Les Trois Petits Cochons et a été réalisé par Burton Gillett.

Silly Symphonies – Three Little Pigs

Les studios concurrents de Disney, Warner Bros., se sont directement inspirés du concept Silly Symphonies de Disney pour créer Looney Tunes et Merrie Melodies.

Three Little Pigs – 1933

Les trois petits cochons Nif-Nif (Fiddler Pig),  Nouf-Nouf (Fifer Pig) et Naf-Naf (Practical Pig) construisent respectivement des maisons de paille, de bois et de briques. Le grand méchant loup détruit en soufflant les deux premières avant de se heurter à la solidité de la troisième dans laquelle se sont réfugiés les trois cochons, il souffle encore jusqu’à en perdre son pantalon. Il tente alors de s’introduire par la cheminée mais Naf-Naf, le plus sage des petits cochons, l’ayant entendu, ajoute de la térébenthine dans une grande marmite d’eau bouillante. Le loup descend et tombe dans la marmite avec l’eau bouillante ; de douleur il crie, saute et s’enfuit dans la forêt, traînant son derrière au sol en hurlant tandis que les petits cochons sauvés rient de cette infortune.

Sur le mur de la maison de pierre on peut apercevoir les portraits de la mère (Mother) et du père (Father) des trois petits cochons, représentant respectivement une truie allaitant sept porcelets et un chapelet de saucisses.

Le film a reçu en 1934 un Oscar pour le meilleur court-métrage d’animation.

Le loup souffle la maison en paille

Le loup se déguise en mouton

Le loup se déguise en vendeur de brosses juif

Version censurée du loup déguisé en vendeur de brosses

Les trois cochons fêtent la fuite du loup

The Big Bad Wolf – 1934

Sorti en 1934, le film Le grand méchant loup est la suite des trois petits cochons. Il est basé sur le conte de tradition orale Le Petit Chaperon Rouge. Il a été réalisé également par Buron Gillet. L’histoire est la suivante:

Le petit chaperon rouge rencontre les trois petits cochons sur le chemin la menant à la maison de sa grand-mère. Naf-Naf, le cochon pratique, préfereait prendre le long chemin pour éviter les bois mais le reste de la troupe préfère prendre le raccourci, boisé. Surgi alors le Grand Méchant Loup. Les cochons s’enfuient et abandonnent le petit chaperon rouge. Le loup la poursuit jusqu’à la maison de la grand-mère. Il parvient à les enfermer dans la garde-robe en vue de les manger. Heureusement, le cochon pratique arrive et met du pop-corn et des braises brûlantes dans le pantalon du loup qui s’enfuit en hurlant. La grand-mère et le petit chaperon rouge sont sauvées.

Le Grand Méchant Loup et le Chaperon Rouge

Three Little Wolfes – 1936

La troisième épisode avec les trois cochons a été réalisée en 1936 par David Hand. Le grand méchant loup apprend à ses trois petits loups les bases de leur nourriture et de la cuisine, principalement du cochon.

Dans la famille des caractères de Disney, le Grand Loup est le seul à avoir des enfants, et non des neveux, comme les autres figures.

Du côté des cochons, Naf-Naf finit l’installation du Pacificateur de loup tandis que les deux autres petits cochons jouent à crier au loup sur leur frère. Mais le loup arrive déguisé, capture les deux joueurs et les enferme dans sa maison.

Finalement Naf-Naf va au secours de ses frères et réussit à introduire le loup dans la machine de pacification où il est maltraité.

The Practical Pig – 1939

Le Cochon Pratique est la dernière épisode des Silly Symphonies avec les trois cochons; elle a été réalisée en 1939 par Dick Rickard.

Le loup se déguise en sirène pour attraper Nif-Nif et Nouf-Nouf lors d’une baignade. Il les mène à la maison où les louveteaux attendent avec impatience le déjeuner. Le loup veut partir d’abord chercher Naf-Naf et il commande à ses enfants de ne pas commencer à manger avant son retour. Malgré ces instructions, les jeunes loups commencent à préparer un plat avec les deux cochons qui leur rappellent qu’il faut obéir à son père.

Le loup se déguise en facteur des postes et fournit un faux message à Naf-Naf qui réussit à l’introduire dans un détecteur de mensonges. Nif-Nif et Nouf-Nouf arrivent à s’échapper et à retourner à la maison de Naf-Naf, le cochon pratique. A la fin le loup est lancé avec une fusée dans les nuages.

The Practical Pig

The Thrifty Pig – 1941

The Thrifty Pig (le cochon économe) est le premier court métrage d’animation américain réalisé par Walt Disney Productions en coopération avec le Department of National Defense et l’Office National du Film du Canada, sorti aux États-Unis et au Canada le 19 novembre 1941.

Il s’agit d’un remake de la Silly Symphony des Trois Petits Cochons (1933) avec le Grand Méchant Loup, devenu nazi essayant (mais échouant) de détruire la maison qu’un des cochons a construit avec les bons de guerre canadiens.

Le réalisateur a été Ford Beebe.

Blitz Wolf – 1942

Der Gross méchant loup est un autre film de propagande anti-nazi de la Seconde Guerre mondiale parodiant Adolf Hitler. Sorti en août 1942, ce court-métrage d’animation américain fut réalisé par Tex Avery et produit par Fred Quimby, directeur de la branche animation de la Metro-Goldwyn-Mayer.

Dans ce dessin animé, les cochons partent en guerre contre Adolf le Loup qui menace d’envahir Pigmania (Cochonland).  Les deux cochons qui construisent leurs maisons en paille et en bois déclarent qu’ils n’ont pas besoin de prendre des précautions contre le loup puisqu’ils ont signé un Pacte de non-agression avec lui. Le cochon qui construit sa maison en pierre, le Sergent Pur Porc (Sergeant Pork) prend ses précautions et renforce sa maison avec un puissant dispositif de défense composé de barbelés, de bunkers, d’obusiers et de tranchées.

Adolf le Loup envahit Cochonland, malgré les deux cochons lui rappelant qu’il a signé un traité avec eux. Il détruit leurs maisons jusqu’à ce que les cochons se replient sur la maison du Sergent Pur Porc. C’est alors que débute la bataille entre le loup et les cochons. À la fin du cartoon, Adolf le Loup est éjecté hors de son bombardier par les obus remplis d’obligation de guerre des cochons et chute vers le sol où une bombe qui explose l’envoie en enfer.

Le film fut nommé dans la catégorie Oscar du meilleur court-métrage d’animation en 1942.

Pigs in a Polka – 1943

La Polka des pourceaux est un film américain réalisé par Friz Freleng, sorti en 1943 et ressorti en tant que cartoon Blue Ribbon en 1948. Il est dans le domaine public.

Ce cartoon Merrie Melodies met en scène les trois petits cochons et le grand méchant loup sur les danses hongroises de Johannes Brahms. Le film a été nommé pour un Oscar du meilleur court métrage d’animation en 1943.

Peter and the Wolf -1946

Pierre et le Loup est un conte musical pour enfants, dont le compositeur russe Sergueï Prokofiev (1891 – 1953) a écrit le texte et composé la musique en 1936, année de son retour définitif en URSS.

Pierre, un jeune garçon, vit dans la campagne russe avec son grand-père. Un jour, il laisse la porte du jardin ouverte : un canard profite de l’occasion pour aller nager dans la mare toute proche. Il se querelle avec un oiseau. À ce moment, un chat s’approche; l’oiseau, alerté par Pierre, s’envole pour se réfugier dans un arbre.

Le grand-père de Pierre ramène le garçon à la maison en bougonnant et referme la porte, car le loup pourrait surgir. Pierre attend que son grand père s’endorme pour aller chasser le loup, Le chat monte se réfugier dans l’arbre pendant que le canard, qui, tout excité, était sorti de la mare, se fait avaler par le loup.

Pierre prend une corde et, en escaladant le mur du jardin, grimpe dans l’arbre. L’oiseau décide d’aller voltiger autour de la tête du loup pour détourner son attention. Pendant ce temps, Pierre forme un nœud coulant avec lequel il parvient à attraper le loup par la queue.

Les chasseurs sortent de la forêt. L’oiseau dit aux chasseurs qu’il y avait le loup dans la forêt et ces derniers vont aider Pierre. Mais Pierre les arrête car il a attrapé le loup. Tous ensemble entament une marche triomphale pour emmener le loup au zoo. Ils organisent une grande fête.

En 1946, les studios Disney se sont basés sur cette oeuvre pour en faire un court-métrage d’animation Pierre et le Loup, dans une séquence du film La Boîte à Musique. Le réalisateur a été Clyde Geronimi.

Père Castor et les cochons – 1993

Le Père Castor est une collection de l’éditeur Flammarion qui publie depuis 1931 des ouvrages pour les enfants de 1 à 10 ans. Père Castor ne laisse jamais passer une occasion de raconter une histoire à ses trois enfants, Câline, Grignote et Benjamin. Il les laisse ensuite en tirer leurs propres conclusions.

Le Père Castor a inspiré une série télévisée d’animation en 156 épisodes de 6 minutes, intitulé Les Belles Histoires du père Castor, réalisée par J. Cubaud et P. Moreaux. La première diffusion a lieu en 1993 sur France 3 et Canal J. Elle est rediffusée sur France 5 dans Zouzous depuis l’année 2011.

Les histoires suivantes se réfèrent à des cochons :

  • 7: L’Extravagant désir de Cochon Rose
  • 57: Les Trois Petits Cochons
  • 77: Deux Petits Cochons trop cochons
  • 99: Le Petit Cochon trop gourmand
  • 141: La Poule, le Coq, le Cochon

Le père Castor raconte une histoire à ses enfants

L’extravagant désir de Cochon Rose

Les trois petits cochons

Le loup des contes de père Castor

Deux petits cochons trop cochons

La poule, le coq et le cochon

Les trois petits cochons s’amusent – 1989

Basé sur le court métrage Les Trois Petits Cochons de la série des Silly Symphonies, les trois petits cochons s’amusent est un jeu vidéo d’aventure développé et édité par Coktel Vision, sorti en 1989 sur Amiga et Atari ST.

Caméos du Grand Méchant Loup

Un caméo dans le monde du théâtre et du cinéma est l’apparition fugace d’une personnalité déjà célèbre. C’est avant tout un clin d’œil, c’est pourquoi il n’est généralement pas crédité. Il est bref et souvent anecdotique, car il n’influe généralement pas sur le cours de l’histoire. Il peut être ouvertement montré, ou bien décelable par les seuls spectateurs avertis.

Le Grand Méchant Loup apparaît souvent dans des caméos. Une scène bien connue est la bande d’annonce de la série  Micky Mouse Club, lancé en 1995, où les trois petits cochons traînent le loup, attaché avec une corde, dans la grande parade.

Bande annonce de la série d’animation Micky Mouse Club 1955

Caméo du Grand Méchant Loup et des Trois Petits Cochons

Liens

Evolution of character encoding

In computing, character encoding is used to represent a repertoire of characters by some kind of encoding system. Character encoding started with the telegraph code. The numerical values that make up a code space are called code points (or code positions).

ASCII

One of the most used character encoding scheme is ASCII, abbreviated from American Standard Code for Information Interchange. ASCII comprises 128 code points in the range 00hex to 7Fhex. Work on ASCII standardization began in 1960 and the first standard was published in 1963. The first commercial use of ASCII was as a seven-bit teleprinter code promoted by Bell Data Services in 1963. ASCII encodes 128 specified characters into seven-bit integers. The characters encoded are numbers 0 to 9, lowercase letters a to z, uppercase letters A to Z, basic punctuation symbols, a space and some non-printing control codes. The eight bit in an ASCII byte, unused for coding, was often used for error control in transmission protocols.

Extended ASCII

Extended ASCII uses all 8 bits of an ASCII byte and comprises 256 code points in the range 00hex to FFhex. The term is misleading because it does not mean that the ASCII standard has been updated to include more than 128 characters or that the term unambiguously identifies a single encoding. There are hundreds of character encoding schemes, based on ASCII, which use the eight bit to encode 128 additional characters used in other languages than american english or used for special purposes. Some of these codes are listed hereafter:

  • EBCDIC : Extended Binary Coded Decimal Interchange Code, used mainly by IBM
  • ISO 8859 :  a joint ISO and IEC series of standards, comprising 15 variants; the most popular is ISO 8859-1 (called Latin 1)
  • ATASCII and PETSCII : introduced by ATARI and Commodore for the first home computers
  • Mac OS Roman : launched by Apple Computer

Unicode

Unicode Logo

Unicode Logo

Unicode is a computing industry standard for the consistent encoding, representation, and handling of text expressed in most of the world’s writing systems and historical scripts. The standard is maintained by the Unicode Consortium, a non-profit organization. The most recent version of Unicode is 9.0, published in June 2016. Unicode comprises 1.114.112 code points in the range 00hex to 10FFFFhex. The Unicode code space is divided into seventeen planes (the basic multilingual plane, and 16 supplementary planes), each with 65.536 (= 2 exp 16) code points. Unicode provides a unique number for every character, no matter what the platform, no matter what the program, no matter what the language. The Unicode Standard has been adopted by all industry leaders in the information technology domain..

Emoji

Emoji are ideograms and smileys used in electronic messages and web pages. The characters exist in various genres, including facial expressions, common objects, places and animals. Originating on Japanese mobile phones in the late 1990s, emoji have become increasingly popular worldwide since their international inclusion in Apple’s iPhone, which was followed by similar adoption by Android and other mobile operating systems. The word emoji comes from Japanese and means pictogram, the resemblance to the English words “emotion” and “emoticon” is just a coincidence. Emoji are now included in Unicode.

Emoji Candidates

Anyone can submit a proposal for a new emoji character, but the proposal needs to have all the right information for it to have a chance of being accepted. The conditions and the process is described on the Submitting Emoji Character Proposals webpage of the Unicode Consortium. The following figure shows the 8 Emoji candidates for the next meeting (Q4 2016) of the Unicode Technical Committee (UTC). When approved, these characters will be added to Unicode 10.0, for release in June, 2017.

New Emoji Candidates 2016

New Emoji Candidates 2016

Unicode Adapt-a-Character

Unicode launched the initiative Adopt-a-Character to help the non-profit consortium in its goal to support the world’s languages. There are three sponsorship levels : Gold, Silver and Bronze. All sponsors are acknowledged in Unicode’s Sponsors of Adopted Characters and their public Twitter feed with their level of support, and they receive a custom digital badge for their character. Donation for a bronze adoption are only 100 US$.

Unicode Encoding

Unicode can be implemented by different character encodings. The most commonly used encodings are UTF-8, UTF-16, UTF-32. A comparison of the encoding schemes is available at Wikipedia.

UTF-8

UTF-8 is a character encoding capable of encoding all possible characters, or code points, defined by Unicode. UTF-8 was originally designed by Ken Thompson and Rob Pike. The encoding is variable-length and uses 8-bit code units. UTF-8 uses one byte for any ASCII character, all of which have the same code values in both UTF-8 and ASCII encoding, and up to four bytes for other characters. There are three sort of units in a variable-width encoding (multibyte encoding).

  • Singleton : a single unit (one byte)
  • Lead : a lead unit comes first in a multibyte encoding
  • Trail : a trail unit comes afterwards in a multibyte encoding

UTF-8 was first presented in 1993.

UTF-16

UTF-16 is a character encoding capable of encoding all 1,112,064 possible characters in Unicode. The encoding is variable-length, as code points are encoded with one or two 16-bit code units. UTF-16 are incompatible with ASCII files. UTF-16 was developed from an earlier fixed-width 16-bit encoding known as UCS-2 (for 2-byte Universal Character Set) once it became clear that a fixed-width 2-byte encoding could not encode enough characters to be truly universal.

UTF-32

UTF-32 is a protocol to encode Unicode code points that uses exactly 32 bits per Unicode code point. This makes UTF-32 a fixed-length encoding, in contrast to all other Unicode transformation formats which are variable-length encodings. The UTF-32 form of a code point is a direct representation of that code point’s numerical value.

The main advantage of UTF-32, versus variable-length encodings, is that the Unicode code points are directly indexable. This makes UTF-32 a simple replacement in code that uses integers to index characters out of strings, as was commonly done for ASCII. The main disadvantage of UTF-32 is that it is space inefficient.

Unicode Equivalence

Unicode equivalence is the specification by the Unicode character encoding standard that some sequences of code points represent the same character. This feature was introduced in the standard to allow compatibility with preexisting standard character sets. Unicode provides two such notions, canonical equivalence and compatibility.

Code point sequences that are defined as canonically equivalent are assumed to have the same appearance and meaning when printed or displayed. Sequences that are defined as compatible are assumed to have possibly distinct appearances, but the same meaning in some contexts. Sequences that are canonically equivalent are also compatible, but the opposite is not necessarily true.

Unicode Normalization

The Unicode standard also defines a text normalization procedure, called Unicode normalization, that replaces equivalent sequences of characters so that any two texts that are equivalent will be reduced to the same sequence of code points, called the normalization form or normal form of the original text. For each of the two equivalence notions, Unicode defines two normal forms, one fully composed (where multiple code points are replaced by single points whenever possible), and one fully decomposed (where single points are split into multiple ones). Each of these four normal forms can be used in text processing :

  • NFD : Normalization Form Canonical Decomposition
  • NFC : Normalization Form Canonical Composition
  • NFKD : Normalization Form Compatibility Decomposition
  • NFKC : Normalization Form Compatibility Composition

All these algorithms are idempotent transformations, meaning that a string that is already in one of these normalized forms will not be modified if processed again by the same algorithm.

Combining characters

In the context of Unicode, character composition is the process of replacing the code points of a base letter followed by one or more combining characters into a single precomposed character; and character decomposition is the opposite process.

NFC character: C é l i n e
NFC code point 0043 00e9 006c 0069 006e 0065
NFD code point 0043 0065 0301 006c 0069 006e  0065
NFD character C e ◌́ l i n e

Unicode support in OS X Swift

In Swift, strings are comprised of a special data structure called Characters (with capital C), which are made of Unicode scalar values (unique 21-bit numbers). We have seen in the above chapter that ” é ” can be described in two ways :

  • let eAcute = ” \ u {E9} ”                                         // é
  • let combinedEAcute = ” \ u {65} \ u {301}            //  e followed by ´

The accent scalar (U+0301) is called ” COMBINING ACUTE ACCENT “. A Swift Character can contain multiple Unicode scalars, but only if those scalars are supposed to be displayed as a single entity. Otherwise Swift throws an error.

The swift function Process( ) (formerly NSTask) used to run Unix excecutables in OS X apps encodes characters using decomposed unicode forms (NFD). This can be a problem when handling special characters in Swift (hash, dcmodify, …).

The following example shows the use of the DCMTK function dcmodify where the arguments to insert a new tag are handled with the argument

 let argument = ["-i", "(4321,1011)=Ostéomyélite à pyogènes"]

The accented characters are passed in the decomposed form. A workaround is to save the value Ostéomyélite à pyogènes in a first step in a text file (Directory/Temp.txt) into a temporary folder and to use the dcmodify “if” option to pass the text file in the argument:

 let argument = ["-if","(4321, 1011)=" + Path to Directory/Temp.txt]

The accented characters are now passed in the composed form as wanted.

UTF-8 support in DICOM

Today UTF-8 characters are supported in most DICOM applications, if they are configured correctly. The Specific Character Set (0008,0005) identifies the Character Set that expands or replaces the Basic Graphic Set for values of Data Elements that have Value Representation of SH, LO, ST, PN, LT or UT.  The defined term for multi-byte character sets without code extensions is ISO_IR 192.

The next figure shows the use of UTF-8 characters in the Orthanc DICOM server.

Orthanc Explorer in 3 Web-Browsers : Safari, Firefox and Microsoft Edge

Orthanc Explorer “Patient Page” in different Web-Browsers : Safari, Firefox and Microsoft Edge

Orthac Explorer "Instance Page in different Web-Browsers : Safari, Firefox and Microsoft Edge

Orthanc Explorer “Instance Page” in different Web-Browsers : Safari, Firefox and Microsoft Edge

Links

Some links to websites providing additional informations about character encoding are listed hereafter :

OrthancMac OS X El Capitan

Last update : February 28, 2018

Introduction

I started the edition of this contribution in June 2015 when I did my first trials with the Orthanc server. In the meantime I created OrthancPi, a mini headless PACS server which is used to host the DICOM teaching files for RadioLogic, an educational tool for radiologists which is currently in alpha test state. It’s now time to update and finalize my post about the installation of the Orthanc server on my MacBookAir computer. The goal is the development of OrthancMac, a midi PACS server for RadioLogic which is more powerful and user-friendly than OrthancPi. Some figures included in the present post refer to earlier versions of Orthanc and to OS X Yosemite because it would be waste time to replace them all with current screenshots.

Some informations provided in the present post are trivial and redundant with my other posts about DICOM and Orthanc. I assembled them for my own needs to get familiar with Orthanc and OS X developments.

Orthanc

Orthanc is a open-source, lightweight DICOM server for healthcare and medical research. It’s now also called a VNA (Vendor Neutral Archive). Orthanc can turn any computer running Windows, Linux or OS X into a PACS  (picture archiving and communication system) system. Orthanc provides a RESTful API and is built on the top of DCMTK (collection of libraries and applications implementing large parts of the DICOM standard). Orthanc is standalone because all the dependencies can be statically linked.

The developer of Orthanc is Sébastian Jodogne, a belgian medical imaging engineer (2011) of the CHU of Liège (University Hospital) who holds a PhD in computer science (2006) from the University of Liège (ULG).

Orthanc source code

The Orthanc source code is available at Bitbucket. The latest stable Orthanc version is 1.3.1 released on November 2, 2017. Some changes have been done since that date. I downloaded the default (mainline) zip file from the Bitbucket project page and saved the unzipped orthanc folder into a directory named orthancmac located at the Mac OSX (El Capitan) desktop. My configuration is slightly different than the assumed structure in the Darwin compilation instructions, but I prefer this development setup.

The following folders and files are included in the orthanc folder :

  • Core/
  • OrthancExplorer/
  • OrthancServer
  • Plugins/
  • Resources/
  • UnitTestSources/
  • .travis.yml  (to trigger automated builds)
  • CMakeLists.txt
  • README, AUTHORS, COPYING, INSTALL, NEWS, THANKS
  • LinuxCompilation.txt and DarwinCompilation.txt

The build infrastructure of Orthanc is based upon CMake. The build scripts are designed to embed all the third-party dependencies directly inside the Orthanc executable. Cmake uses the concept Out of source Build where the build directory is separated from the source directory.

I created a folder build inside the orthanc directory and opened a terminal window inside this build folder.

cd desktop/orthancmac/orthanc/build

To prepare the build process (configuration) on Mac OS X El Capitan, I entered the following command in the terminal window :

cmake .. -GXcode -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11
-DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DALLOW_DOWNLOAD=ON
~/desktop/orthancmac/build

The cmake options are :

-G : specify a makefile generator
-D : create a cmake cache entry

The cmake cache entries are :

CMAKE_OSX_DEPLOYMENT_TARGET : 10.11
STATIC_BUILD : ON
STANDALONE_BUILD : ON
ALLOW_DOWNLOAD : ON

The following figure shows the configuration process when using the CMake-GUI :

Orthanc

Orthanc configuration with CMake GUI

During the configuration process, the following files have been downloaded from the website http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/ :

All the files have been saved in a new folder orthancmac/orthanc/ThirdPartyDownloads. The programs SQlite3 and Python 2.7.10 have been found installed.

Configuration messages, warnings and errors

During the configuration process, the following messages, warnings and errors have been stated :

Files not found

The following files and definitions have not been found during the processing of DCMTK : fstream, malloc, ieeefp, iomanip, iostream, io, png, ndir, new, sstream, stat, strstream, strstrea, sync, sys/ndir, sys/utime, thread, unix, cuserid, _doprnt, itoa, sysinfo, _findfirst, isinf, isnan, uchar, ulong, longlong, ulonglong

Patching

The following files have been patched :

  • dcmtk-3.6.0/dcmnet/libsrc/dulfsm.cc
  • dcmtk-3.6.0/dcmnet/libsrc/dul.cc

Cmake policies

– policy CMP0042 not set
– policy CMP0054 not set
To avoid the cmake_policy warning, I added the following command to the  CmakeLists.txt file at the beginning :

if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()

INFOS

DCMTK’s builtin private dictionary support will be disabled
Thread support will be disabled
OS X Path not specified for the following targets:
– ModalityWorklists
– ServeFolders

DOXYGEN

Doxygen not found. The documentation will not be built.

Orthanc Xcode Building

The Build directory contains the following folders and files after the configuration and generation process :

  • AUTOGENERATED/
  • boost_1_60_0/
  • curl-7.50.3/
  • dcmtk-3.6.0/
  • gtest-1.7.0/
  • jpeg-9a/
  • jsoncpp-0.10.5/
  • libpng-1.5.12/
  • lua-5.1.5/
  • mongoose/
  • openssl-1.0.2d/
  • pugixml-1.4/
  • zlib-1.2.7/
  • CMakeFiles/
  • CMakeTmp/
  • CMakeScripts/
  • CMakeCache.txt
  • cmake_install.cmake
  • cmake_uninstall.cmake
  • Orthanc.xcodeproj

To build the project, I entered the following command in the terminal window inside the build folder :

xcodebuild -configuration Release

The build was successful, the following warnings have been issued :

  • 3 -> curl
  • 1 -> lua
  • 4 -> monggose
  • 5 -> zlib
  • 3 -> openssl
  • > 100 -> DCMTK
  • 1 -> Orthanc

The following figure shows the building process when using the Xcode GUI.

Orthanc

Orthanc Building with Xcode GUI

The eight targets are show at the left in red. To build the Release version, I modified the scheme in the Xcode-GUI. Building with the command line is much easier.

After the succesfull  build, the following folders and files were added to the Build folder :

  • Release/
  • Orthanc.build/

The Release folder contains the executables Orthanc, UnitTest and OrthancRecoverCompression, the libraries libCoreLibrary.a, libOpenSSL.a, libServerLibrary.a, libServeFolders.mainline.dylib and libModalityWorklists.mainline.dylib. These files are the targets of the Xcode building process.

Running the Orthanc server

The Orthanc configuration file Configuration.json is located in the folder orthanc-default/Resources. I copied this file into the Release folder and started the DICOM server with the command

./Orthanc Configuration.json

inside the Release folder.

Orthanc

Orthanc Server Start with Terminal Window

At the first start of the server, a new folder OrthancStorage is created inside the Release directory. The OrthancStorage folder contains the SQLite files index, index-shm and index-wal.

Entering the url localhost:8024 in the Safari address field opens the main window (explorer) of the Orthanc server.

Orthanc Explorer

Orthanc Explorer at localhost

Clicking the upload button opens an new window in the Orthanc server where I added some DICOM files from CD’s (drag and drop).

Orthanc

Uploading DICOM files with Orthanc Server

The DICOM files are saved in sub-folders in the OrthancStorage directory in a flat structure.

I modified the configuration.json file to allow the remote access to the server from another computer located in the same local network.

/**
* Security-related options for the HTTP server
**/
// Whether remote hosts can connect to the HTTP server
"RemoteAccessAllowed" : true,

The remote anonymous access is now possible. When the remote access is not allowed, the server requests a user-id and password when entering the URL in the browser address bar :

http://192.168.168.55:8042/app/explorer.html

Orthanc allows the following actions :

Action Patient Study Series Instance
protect/unprotect x
delete x x x x
send to remote modality x x x x
anonimize x x x
preview x x
download ZIP x x x
download DICOMDIR x x x
download DICOM file x
download JSON file x

Protection

Because of its focus on low-end computers, Orthanc implements disk space recycling: the oldest series of images can be automatically deleted when the available disk space drops below a threshold, or when the number of stored series grows above a threshold. This enables the automated control of the disk space. Recycling is controlled by the MaximumStorageSize and the MaximumPatientCount options in the Orthanc configuration file. It is possible to prevent patient data from being automatically recycled by using the Unprotected/Protected switch that is available in Orthanc Explorer.

Testing the server

When the UnitTests executable is launched from the terminal window in the Release folder, 163 tests from 43 test cases were run. All these 163  tests passed. Two tests were disabled.

Orthanc UnitTests

Orthanc UnitTests

Two new folders were created in the Release folder by the testing process : UnitTestsResults and UnitTestsStorage.

RESTful API

The following list shows the main RESTful commands (links work only in my local network):

  • Patients : http://localhost:8042/patients
  • Studies : http://localhost:8042/studies
  • Series : http://localhost:8042/series
  • Instances : http://localhost:8042/instances
  • Patient Name : http://localhost:8042/patients/ba1682fb-3fc01dc1-acaf1294-c0d61888-69ba054b
  • Study CT Colonne cervicale : http://localhost:8042/studies/d4c42ef2-91794610-dfda2fe3-89fff37f-6d38b159
  • Series Col. Cervicale Mou 2.0 MPR spine multi : http://localhost:8042/series/e7f7f651-aeacf5d4-a3832d08-3c7a3efa-2eff3c3a
  • Instance 4 : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32
  • Download instance.dcm : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/file
  • Simplified tags : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/simplified-tags
  • Tags : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/tags
  • Content : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/content
  • Preview : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/preview

A complete grid of the Orthanc RESTful API is available as Google Spreadsheet.

Links

Orthanc Book

Google groups discussions :

Other contributions :

Optional Variables in Apple Swift

Last update: October 26, 2016

Swift is Apples new programming language for iOS, OS X, watchOS, and tvOS app development. The current version is 3.0. Swift provides its own versions of all fundamental data types :

  • Int for integers
  • Double for 32 bit decimals (floating-point values)
  • Float for 64 bit decimals (floating-point values)
  • Bool for Boolean values
  • String for text

Integers are either signed (positive, zero, or negative) or unsigned (positive or zero). Integer literals can be written as:

  • A decimal number, with no prefix
  • A binary number, with a 0b prefix
  • An octal number, with a 0o prefix
  • A hexadecimal number, with a 0x prefix

Floating-point literals can be decimal (with no prefix), or hexadecimal (with a 0x prefix). Decimal floats can also have an optional exponent, indicated by an uppercase or lowercase e.

Swift also provides powerful versions of the three primary collection types :

  • Array
  • Set
  • Dictionary

Swift differentiates between constants and variables. The value of a constant cannot be changed once it is set, whereas a variable can be set to a different value in the future. Constant and variable names can contain almost any character, including Unicode characters.

let π = 3.14159
你好 = "你好世界"
🐶🐮 = "blablabla"

Constants are declared with the keyword “let”.

let myName = "Marco"

Constants are also called immutable because they cannot be changed after you have stored data in them.

Variables are declared with the keyword “var”. Variables are called mutable because you can constantly change the data that they store.

var x = 1.2

There are several possibilities to define a variable or a constant :

implicit :

var yourName = "Oscar"

explicit :

var yourName: String = "Oscar"

separated :

var yourName: String
yourName = "Oscar"

multiple line :

var x=1.2, y=3.4, z=5.6

typealias :

typealias FirstName = String
var hisName: FirstName = "Jeannot"

computed (getter) :

var number: Double {
  get {
    return x + y + z
    }
}

Swift is a type-safe language, which means the language prevents you from passing by mistake a wrong data type to a variable. Data Types can be converted with the functions Int( ), Double( ), Float( ), …

When a variable is declared, it can’t be used until data is stored in it, otherwise the program fails. Initially storing dummy data in a variable can cause errors. Therefore Swift uses the concept of optional variables. If an optional variable contains nothing, it’s considered to hold a value called nil. To create an optional variable, you declare it with its datatype, followed by a question mark :

var ourName : String?

Storing data in an optional variable is not different than storing data in an ordinary variable.

ourName = "Simone"

Retrieving data from an optional variable is however different and requires additional steps. After checking that the optional variable contains data, you have to unwrap it to get the actual data.  Unwrapping is done with the exclamation mark :

print(ourName!)

If you retrieve an optional variable containing a nil value the program will fail. Therefore we must first check that it contains data. This can be done in two ways :

explicit check

if ourName != nil {
   // retrieve value with ourName!
} else {
   // do something else
}

optional binding (constant assignment)

if let rumpelstilzchen = ourName {
  // retrieve value with rumpelstilzchen or ourName!
}

Optional variables are at the heart of many of Swift’s most powerful features. Once you understand the concept, they are very useful to link a user interface item to Swift code with IBOutlet variables.

A common user interface are text fields that are often empty at the program start. If a IBOutlet is defined as optional variable as follows

@IBOutlet weak var labelText: NSTextField?

we need to use the exclamation mark every time we want to access the data stored in this variable, which can be error prone and make the code hard to read. If we define the IBOutlet variable as an implicit unwrapped optional variable with an exclamation mark

@IBOutlet weak var labelText: NSTextField!

we can access it without question mark if it contains a value. In the case of IBOutlets Xcode catches any potential error, but this is not the case for other potential variables where you need to check and unwrap yourself the data.

The Aerial Bold Project

Aerial Bold : Kickstart the Planetary Search for Letterforms!” is the 11th Kickstarter project that I funded. The project was launched by Benedikt Groß & Joey Lee on October 14, 2014. After two weeks, 100% was funded by 480 bakers. At the end 569 backers pledged 11.492 $ to help bring this project to life.

Aerial Bold is the first map and typeface of the earth. The project is literally about reading the earth for letterforms, or alphabet shapes, written into the topology of buildings, roads, rivers, trees, and lakes. To do this, Benedikt Groß and Joey Lee traversed the entire planet’s worth of satellite imagery and developed the tools and methods necessary to map these features hiding in plain sight.

On March 8, 2016, the results were finally presented. The entire letterform database has been made available as a usable dataset for any art – design – science – textual project. Selected letterforms have been converted into a truetype – opentype font format that can be imported into any word processor.

The results of the project are presented at the Aerial Bold Project website. An embedded typewriter allows to enter text with the different fonts :  Satellite, Buildings, Suburbia, Provence. The size, offset, background and location of the fonts can be selected.

Aerial Bold

Aerial Bold Typewriter : Satellite font, Hamburg, size 150, offset 0, red background

Additional information about the process, data, fonts and credits are available at the project website. A catalog and posters complete the documentation. Below are some pictures of my name written with the Aerial Bold fonts.

Aerial Bold Satellite Font

Aerial Bold Satellite Font

Aerial Bold Buildings Font

Aerial Bold Buildings Font

Aerial Bold Suburbia Font

Aerial Bold Suburbia Font

Aerial Bold Provence Font

Aerial Bold Provence Font

Orthanc Raspberry Pi

Last update : March 20, 2016

This contribution explains how to implement an Orthanc DICOM PACS Server on a Raspberry Pi (RPI) standalone single-board computer. The Orthanc source code was compiled on a Raspberry Pi 1 model B computer and tested on RPI models B Pi 1, Pi 2 and Pi 3. I use Raspbian Jessie for my RPI’s, a free operating system based on Debian, optimized for the Raspberry Pi hardware. I call the resulting mini PACS server an OrthancPi.

rpi

Raspberry Pi genealogy

Debian Med

An Orthanc package for Debian is available at the Debian website. This package is part of Debian Med, a specific flavour of Debian that is particularly well fit for the requirements for medical practice and biomedical research. The Debian Med package is maintained by the developer of Orthanc, Sébastien Jodogne, a Medical Imaging Engineer at the Medical Physics Department from the University Hospital of Liège (CHU) in Belgium.

The stable Orthanc version for Debian Jessie is 0.8.4. The Orthanc version 1.0 is only available for the testing (Stretch) and for the unstable (SID) Debian distributions. A release for the armhf architecture is part of the Orthanc package. The file list of the orthanc package in the Debian stretch distribution for the armhf architecture is the following :

/etc/init.d/orthanc
/etc/orthanc/orthanc.json
/etc/orthanc/serve-folders.json
/etc/orthanc/worklists.json
/usr/lib/orthanc/libModalityWorklists.so.1.0.0
/usr/lib/orthanc/libServeFolders.so.1.0.0
/usr/sbin/Orthanc
/usr/share/doc/orthanc/NEWS.gz
/usr/share/doc/orthanc/README.Debian
/usr/share/doc/orthanc/changelog.Debian.armhf.gz
/usr/share/doc/orthanc/changelog.Debian.gz
/usr/share/doc/orthanc/changelog.gz
/usr/share/doc/orthanc/copyright
/usr/share/lintian/overrides/orthanc
/usr/share/man/man1/Orthanc.1.gz
/usr/share/orthanc/plugins/libModalityWorklists.so
/usr/share/orthanc/plugins/libServeFolders.so

Orthanc Source Code

RPI’s are based on the ARM architecture and Raspbian releases usually follow the corresponding Debian release, but do deviate in a handful of cases. For this reason I preferred to build Orthanc version 1.0 from the source code, located on Bitbucket, on the Raspberry Pi hardware.

I downloaded the repository and put the content into a folder named Orthanc in the Raspberry Pi /home/pi/ directory. The following packages needed for compilation and linking have been installed first :

sudo apt-get install build-essential unzip cmake mercurial \
uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \
libgoogle-glog-dev libgtest-dev libpng-dev libjpeg-dev \
libsqlite3-dev libssl-dev zlib1g-dev libdcmtk2-dev \
libboost-all-dev libwrap0-dev libjsoncpp-dev libpugixml-dev

I created a new folder OrthancBuild inside the /home/pi/ directory and executed the following commands :

cd OrthancBuild
cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ~/Orthanc
make

During the configuration process, the following files have been downloaded from the website http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/ :

All the files have been saved in a new folder orthanc-default/ThirdPartyDownloads. All the third-party dependencies are statically linked to the Orthanc build. The compilation takes more time (several hours), compared to the default behavior where system wide libraries are used. Statically linked builds are however easier to share and to clone.

The result of the compilation was the generation of the following files :

  • Orthanc (executable)
  • UnitTests (executable)
  • libServeFolders.so.mainline (shared library) -> renamed to libServeFolders.so
  • libModalityWorklist.so.mainline (shared library) -> renamed to libModalityWorklist.so
  • libCoreLibrary.a (AR archive)
  • libServerLibrary.a (AR archive)
  • libOpenSSL.a (AR archive)

Running the UnitTests shows that all 154 tests from 43 test cases passed, 2 tests were disabled.

Orthanc UnitTests

Orthanc UnitTests

Orthanc plugins

I used the same procedure to compile the plugins DICOMweb and WebViewer. The source code was copied into the folders /home/pi/Dicomweb/ and /home/pi/Webviewer/. I created the new folders /home/pi/DicomwebBuild/ and /home/pi/WebviewerBuild and finally executed the commands

cd /home/pi/DicomwebBuild
cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ~/Dicomweb
make

cd /home/pi/WebviewerBuild
cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ~/Webviewer
make

The following third-party libraries are used by the plugins :

Dicomweb Webviewer
boost_1_59_0 boost_1_59_0
GDCM-prefix GDCM-prefix
gtest-1.7.0 gtest-1.7.0
jsoncpp-0.10.5 jsoncpp-0.10.5
pugixml-1.4
zlib-1.2.7
cornerstone-0.8.4
javascript-libs
jquery-ui-1.11.3
jspanel
jsurl-1.8.6
pako-0.2.5
sqlite-amalgamation-3071300

The shared libraries libOrthancDicomWeb.so.mainline and libOrthancWebViewer.so.mainline were created as a result of the compilation and linking process. I renamed these libraries without the mainline suffix.

The results of the UnitTests runs are shown hereafter :

Orthanc DicomWeb UnitTests

Orthanc DicomWeb UnitTests

webviewer_tests

Orthanc WebViewer UnitTests

OrthancPi

The OrthancPi distribution files are assembled as follows in a directory named /home/pi/orthancpi/.

  • Orthanc  (executable)
  • UnitTests (executable)
  • configuration.json
  • /plugins/libServeFolders.so
  • /plugins/libModalityWorklists.so
  • /plugins/libOrthancDicomWeb.so
  • /plugins/libOrthancWebViewer.so.
  • /web/index.html (OrthancPi welcome page)
  • /python/ (empty)
  • /lua/ (empty)
  • /WorklistsDatabase/ (worklist samples)
  • /OrthancStorage/ (empty)

The default configuration.json file is created with the command

cd orthancpi
./Orthanc --config=configuration.json

I modified the configuration file as follows :

{
 // ***
 // General configuration of Orthanc
 // ***

 // The logical name of this instance of Orthanc. This one is
 // displayed in Orthanc Explorer and at the URI "/system".
  "Name" : "OrthancPi",

 // Path to the directory that holds the heavyweight files
 // (i.e. the raw DICOM instances)
  "StorageDirectory" : "OrthancStorage",

 // Path to the directory that holds the SQLite index (if unset,
 // the value of StorageDirectory is used). This index could be
 // stored on a RAM-drive or a SSD device for performance reasons.
  "IndexDirectory" : "OrthancStorage",

 // Enable the transparent compression of the DICOM instances
  "StorageCompression" : false,

 // Maximum size of the storage in MB (a value of "0" indicates no
 // limit on the storage size)
  "MaximumStorageSize" : 0,

 // Maximum number of patients that can be stored at a given time
 // in the storage (a value of "0" indicates no limit on the number
 // of patients)
  "MaximumPatientCount" : 0,
  
 // List of paths to the custom Lua scripts that are to be loaded
 // into this instance of Orthanc
  "LuaScripts" : [
  ],

 // List of paths to the plugins that are to be loaded into this
 // instance of Orthanc (e.g. "./libPluginTest.so" for Linux, or
 // "./PluginTest.dll" for Windows). These paths can refer to
 // folders, in which case they will be scanned non-recursively to
 // find shared libraries.
 
  "Plugins" : [
  "../plugins/libServeFolders.so",
  "../plugins/libOrthancWebViewer.so",
  "../plugins/libOrthancDicomWeb.so",
  "../plugins/libModalityWorklists.so"
  ],
  
"Worklists" : {
    "Enable": true,
    "Database": "../WorklistsDatabase"
  }, 
  
 "ServeFolders" : {
        "/web" : "/home/pi/orthancpi/web"
  },

  "DicomWeb" : {
     "Enable" : true,
     "Root" : "/dicom-web/",
     "EnableWadoo" : true,
     "WadooRoot" : "/wado",
     "Host" : "localhost",
     "Ss1" : false
  },

 // **
 //  Configuration of the HTTP server
 // **

 // Enable the HTTP server. If this parameter is set to "false",
 // Orthanc acts as a pure DICOM server. The REST API and Orthanc
 // Explorer will not be available.
  "HttpServerEnabled" : true,

 // HTTP port for the REST services and for the GUI
  "HttpPort" : 8042,

 // When the following option is "true", if an error is encountered
 // while calling the REST API, a JSON message describing the error
 // is put in the HTTP answer. This feature can be disabled if the
 // HTTP client does not properly handles such answers.
  "HttpDescribeErrors" : true,

 // Enable HTTP compression to improve network bandwidth utilization,
 // at the expense of more computations on the server. Orthanc
 // supports the "gzip" and "deflate" HTTP encodings.
  "HttpCompressionEnabled" : true,

 // **
 // Configuration of the DICOM server
 // **

 // Enable the DICOM server. If this parameter is set to "false",
 // Orthanc acts as a pure REST server. It will not be possible to
 // receive files or to do query/retrieve through the DICOM protocol.
  "DicomServerEnabled" : true,

 // The DICOM Application Entity Title
  "DicomAet" : "ORTHANCPI",

 // Check whether the called AET corresponds during a DICOM request
  "DicomCheckCalledAet" : false,

 // The DICOM port
  "DicomPort" : 4242,

 // The default encoding that is assumed for DICOM files without
 // "SpecificCharacterSet" DICOM tag. The allowed values are "Ascii",
 // "Utf8", "Latin1", "Latin2", "Latin3", "Latin4", "Latin5",
 // "Cyrillic", "Windows1251", "Arabic", "Greek", "Hebrew", "Thai",
 // "Japanese", and "Chinese".
  "DefaultEncoding" : "Utf8",

 // The transfer syntaxes that are accepted by Orthanc C-Store SCP
  "DeflatedTransferSyntaxAccepted"     : true,
  "JpegTransferSyntaxAccepted"         : true,
  "Jpeg2000TransferSyntaxAccepted"     : true,
  "JpegLosslessTransferSyntaxAccepted" : true,
  "JpipTransferSyntaxAccepted"         : true,
  "Mpeg2TransferSyntaxAccepted"        : true,
  "RleTransferSyntaxAccepted"          : true,

 // Whether Orthanc accepts to act as C-Store SCP for unknown storage
 // SOP classes (aka. "promiscuous mode")
  "UnknownSopClassAccepted"            : false,

 // **
 // Security-related options for the HTTP server
 // **

 // Whether remote hosts can connect to the HTTP server
  "RemoteAccessAllowed" : true,

 // Whether or not SSL is enabled
  "SslEnabled" : false,

 // Path to the SSL certificate (meaningful only if SSL is enabled)
  "SslCertificate" : "certificate.pem",

 // Whether or not the password protection is enabled
  "AuthenticationEnabled" : false,

 // The list of the registered users. Because Orthanc uses HTTP
 // Basic Authentication, the passwords are stored as plain text.
  "RegisteredUsers" : {
 // "alice" : "alicePassword"
  },

 // **
 //  Network topology
 // **

 // The list of the known DICOM modalities
  "DicomModalities" : {
 // **
 //    * Uncommenting the following line would enable Orthanc to
 //    * connect to an instance of the "storescp" open-source DICOM
 //    * store (shipped in the DCMTK distribution) started by the
 //    * command line "storescp 2000".
 //   **
 // "sample" : [ "STORESCP", "localhost", 2000 ]
	"Horos" : [ "HOROS", "192.168.123.200", 104 ],
	"dcm4che" : [ "DCM4CHE", "192.168.123.201", 104 ]

// **
//    * A fourth parameter is available to enable patches for a
//     * specific PACS manufacturer. The allowed values are currently
//    * "Generic" (default value), "StoreScp" (storescp tool from
//    * DCMTK), "ClearCanvas", "MedInria", "Dcm4Chee", "SyngoVia",
//    * "AgfaImpax" (Agfa IMPAX), "EFilm2" (eFilm version 2), and
//     * "Vitrea". This parameter is case-sensitive.
//  **
// "clearcanvas" : [ "CLEARCANVAS", "192.168.1.1", 104, "ClearCanvas" ]
  },

 // The list of the known Orthanc peers
  "OrthancPeers" : {
 // **
//     * Each line gives the base URL of an Orthanc peer, possibly
//    * followed by the username/password pair (if the password
//    * protection is enabled on the peer).
//  **
// "peer"  : [ "http://localhost:8043/", "alice", "alicePassword" ]
// "peer2" : [ "http://localhost:8044/" ]
	"OrthancMac" : [ "http://192.168.123.210:8042/" ]
  },

// Parameters of the HTTP proxy to be used by Orthanc. If set to the
// empty string, no HTTP proxy is used. For instance:
//   "HttpProxy" : "192.168.0.1:3128"
//   "HttpProxy" : "proxyUser:proxyPassword@192.168.0.1:3128"
  "HttpProxy" : "",

// Set the timeout for HTTP requests issued by Orthanc (in seconds).
  "HttpTimeout" : 10,

// Enable the verification of the peers during HTTPS requests.
// Reference: http://curl.haxx.se/docs/sslcerts.html
  "HttpsVerifyPeers" : true,

// Path to the CA (certification authority) certificates to validate
// peers in HTTPS requests. From curl documentation ("--cacert"
// option): "Tells curl to use the specified certificate file to
// verify the peers. The file may contain multiple CA
// certificates. The certificate(s) must be in PEM format."
  "HttpsCACertificates" : "",

// **
// Advanced options
// **

// Dictionary of symbolic names for the user-defined metadata. Each
// entry must map an unique string to an unique number between 1024
// and 65535.
  "UserMetadata" : {
 // "Sample" : 1024
  },

// Dictionary of symbolic names for the user-defined types of
// attached files. Each entry must map an unique string to an unique
// number between 1024 and 65535. Optionally, a second argument can
// provided to specify a MIME content type for the attachment.
  "UserContentType" : {
 // "sample" : 1024
 // "sample2" : [ 1025, "application/pdf" ]
  },

// Number of seconds without receiving any instance before a
// patient, a study or a series is considered as stable.
  "StableAge" : 60,

// By default, Orthanc compares AET (Application Entity Titles) in a
// case-insensitive way. Setting this option to "true" will enable
// case-sensitive matching.
  "StrictAetComparison" : false,

// When the following option is "true", the MD5 of the DICOM files
// will be computed and stored in the Orthanc database. This
// information can be used to detect disk corruption, at the price
// of a small performance overhead.
  "StoreMD5ForAttachments" : true,

// The maximum number of results for a single C-FIND request at the
// Patient, Study or Series level. Setting this option to "0" means
// no limit.
  "LimitFindResults" : 0,

// The maximum number of results for a single C-FIND request at the
// Instance level. Setting this option to "0" means no limit.
  "LimitFindInstances" : 0,

// The maximum number of active jobs in the Orthanc scheduler. When
// this limit is reached, the addition of new jobs is blocked until
// some job finishes.
  "LimitJobs" : 10,

// If this option is set to "false", Orthanc will not log the
// resources that are exported to other DICOM modalities of Orthanc
// peers in the URI "/exports". This is useful to prevent the index
// to grow indefinitely in auto-routing tasks.
  "LogExportedResources" : true,

// Enable or disable HTTP Keep-Alive (deprecated). Set this option
// to "true" only in the case of high HTTP loads.
  "KeepAlive" : false,

// If this option is set to "false", Orthanc will run in index-only
// mode. The DICOM files will not be stored on the drive. Note that
// this option might prevent the upgrade to newer versions of Orthanc.
  "StoreDicom" : true,

// DICOM associations are kept open as long as new DICOM commands
// are issued. This option sets the number of seconds of inactivity
// to wait before automatically closing a DICOM association. If set
// to 0, the connection is closed immediately.
  "DicomAssociationCloseDelay" : 5,

  // Maximum number of query/retrieve DICOM requests that are
  // maintained by Orthanc. The least recently used requests get
  // deleted as new requests are issued.
  "QueryRetrieveSize" : 10,

// When handling a C-Find SCP request, setting this flag to "true"
// will enable case-sensitive match for PN value representation
// (such as PatientName). By default, the search is
// case-insensitive, which does not follow the DICOM standard.
  "CaseSensitivePN" : false,
  
// Register a new tag in the dictionary of DICOM tags that are known
// to Orthanc. Each line must contain the tag (formatted as 2
// hexadecimal numbers), the value representation (2 upcase
// characters), a nickname for the tag, possibly the minimum
// multiplicity (> 0 with defaults to 1), and possibly the maximum
// multiplicity (0 means arbitrary multiplicity, defaults to 1).
  "Dictionary" : {
// "0014,1020" : [ "DA", "ValidationExpiryDate", 1, 1 ]
  }
}

I copied the whole orthancpi directory with an USB card reader to different Raspberry Pi modules which were configured to run as headless servers with remote control, using various wifi adapters. The process is explained in my post Rasperry Pi revisited.

To start the OrthancPi server at boot, a file orthanc.desktop has been added to the /home/pi/.config/autostart/ folder. This is the content of this file

[Desktop Entry]
Type=Application
Name=ORTHANC
Exec=/home/pi/orthancpi/Orthanc /home/pi/orthancpi/configuration.json
StartupNotify=false

OrthancPi can also be configured to run as a Debian daemon.

An OrthancPi server will be used in the context of the RadioLogic project, a training tool for radiology. This tool will be used in classrooms without Internet access. The OrthancPi server works as wireless access point. To extend the WiFi range, a  repeater can be used. The RadioLogic tool is web based and optimized to run on iPad’s which are connected to the OrthancPi WLAN. The following figure shows two OrthancPi servers with USB WiFi adapters using  Ralink RT5370 chips.

OrthancPi's with USB WiFi adapters, SDcards and SDcard-reader

OrthancPi’s with USB WiFi adapters, SDcards and SDcard-reader

A user guide for the OrthancPi is available at the RadioLogic website. Disk image files to set up an OrthancPi server in a plug and play way, with different WiFi adapters, are available at the same webpage.