Anatomist commands system¶
Syntaxe des commandes¶
Les commandes peuvent être
La syntaxe des commandes est celle des arbres de la librairie
graph de Dimitri Papadopoulos:
La syntaxe est connue d'Anatomist (chaque commande déclare la syntaxe qu'elle attend).*BEGIN TREE syntaxe
attribut1 valeur1
attribut2 valeur2
...
*END
Chaque type syntaxique (ou type d'arbre, attribut donné après "*BEGIN TREE") décide des attributs qu'il est possible de trouver dans cet élément (arbre).
Les attributs ont chacun un type, et peuvent être obligatoires ou non.
Les types de base pour les attributs sont:
Type | Example |
---|---|
int | 12 |
float | -134.654 |
string | toto et tutu |
int_vector | 1 20 -2 4 87 |
float_vector | 1.2 -3.4 0.123 -12. |
dictionary | { '__syntax__' : 'dictionary', 'an_attribute' : [ 1, 5.3, 'value' ] } |
Les commandes sont encapsulées dans des arbres imbriqués a priori sur 2 niveaux: le premier précise si la commande doit être exécutée ou annulée: syntaxe EXECUTE ou UNDO. Le second niveau est la commande elle-même. Ex:
Les objets et fenêtres sont manipulées en interne dans Anatomist par leurs pointeurs. Evidemment ce format n'est pas exportable dans les entrées/sorties disque. On passe donc par une conversion pointeur - identifiant entier, effectuée par les classes Serializer et Unserializer. Le principe est qu'un pointeur en mémoire est identifié depuis les commandes par un entier. L'entier est attribué au pointeur depuis sa création, par la commande qui résulte en la création de pointeur (nouvel objet chargé ou crée par fusion, nouvelle fenêtre ouverte, etc.). Ces commandes ont généralement un attribut "res_pointer " qui donne l'identifiant entier qui sera ensuite utilisé pour référer à ce pointeur (objet, fenêtre, référentiel...).*BEGIN TREE EXECUTE
*BEGIN TREE LoadObject
filename toto.ima
res_pointer 1
*END
*END
Dans la suite, à chaque fois qu'on manipule des objets, des fenêtre, des référentiels, on les désigne par cet identifiant.
Ex: la commande suivante met les objets d'identifiants 1, 2 et 3 dans les fenêtres d'identifiants 100 et 101.
Attention: dans les "scripts" de commande, ne jamais confondre des identifiants d'éléments de types différents (par exemple un ID de fenêtre dans une liste d'objets), c'est pas du tout blindé pour le moment et ça doit pouvoir faire planter méchamment.*BEGIN TREE EXECUTE
*BEGIN TREE AddObject
objects 1 2 3
windows 100 101
*END
*END
Précisions sur les identifiants:
Dictionary type¶
The dictionary
type is a free type that allows to contain almost any type of generic data: numbers, strings, lists, dictionaries.
This dictionary type format is taken from python format (for now: XML will also be handled in the future) because the standard commands format (“tree” format) does not handle this type.
For instance:
{ '__syntax__' : 'dictionary', 'no_decoration': 1 }
The __syntax__
attribute is mandatory right now (even if it is not used) because of a limitation of the reading system which can be regarded as a bug and that we will fix one day.
Commands definition¶
ActivateAction¶
New in Anatomist 4.5Triggers window action activation.
Attribute: | Type: | Description: |
---|---|---|
window | int | ID of the window to trigger action in. The action must be in the currently active control of the window. |
action_type | string | type of action: "key_press", "key_release", "mouse_press", "mouse_release", "mouse_double_click", "mouse_move". Additional parameters depend on the action type. |
method | string | Action method name, as registered in the active control. Deteremines what will actually be done. |
x | int (optional) | x mouse coord, for mouse actions only. |
y | int (optional) | y mouse coord, for mouse actions only. |
AddObject¶
Adds objects in windowsAttribute: | Type: | Description: |
---|---|---|
objects | int_vector | IDs of objects to be added in specified windows |
windows | int_vector | IDs of windows |
add_children | int (optional) |
New in Anatomist 3.1.5 Also add the given objects children (useful for graphs for instance) |
add_graph_nodes | int (optional) |
New in Anatomist 3.1.5 Also add the given objects children nodes if they are graphs. This is a bit more specific than the add_children option which adds all children. Changed in Anatomist 3.2: The default value is now 1. |
add_graph_relations | int (optional) |
New in Anatomist 3.1.5 Also add the given objects children relations if they are graphs. This is a bit more specific than the add_children option which adds all children. |
temporary | int (optional) |
New in Anatomist 3.5.1 Temporary objects do not affect the window bounding box and camera settings. |
position | int (optional) |
New in Anatomist 3.5.1 Position in objects order list. |
ApplyBuiltinReferential¶
AskTexExtrema¶
Provoque l'affichage dans la sortie standard d'Anatomist des valeurs extrêmes de la texture de l'objetAttribute: | Type: | Description: |
---|---|---|
object | int | objet dont on demande les bornes de la texture |
AssignReferential¶
Attribue (et crée au besoin) un référential à des objets et des fenêtres.Attribute: | Type: | Description: |
---|---|---|
objects | int_vector (optionnel) | |
windows | int_vector (optionnel) | |
central_ref | int | non nul si on désigne le référentiel central (indestructible) d'Anatomist |
filename | string (optionnel) |
Nouveau dans Anatomist 3.1 fichier contenant des information supplémentaires sur le référentiel: en particulier un nom et un UUID (identifiant unique). Si l'UUID lu depuis ce fichier existe déjà dans anatomist, le référentiel n'est pas recréé (sinon l'identifiant ne serait plus unique). On peut donc utiliser la commande AssignReferential juste pour charger des informations complémentaires sur un repère existant. Ce fichier est au format de type .minf (bien que l'extension soit généralement .referential). |
ref_uuid | string (optionnel) |
Nouveau dans Anatomist 3.1 Précise optionnellement qu'on veut utiliser un référentiel précis, d'identifiant unique (et persistant) connu, et déjà présent dans Anatomist. Ce paramètre est généralement incompatible avec le paramètre filename parce que l'UUID trouvé dans le fichier est potentiellement différent de celui précisé ici. |
Camera¶
Sets camera point of view, zoom, etc. in 3D windows.Attribute: | Type: | Description: |
---|---|---|
windows | int_vector | windows to act on |
boundingbox_min | float_vector (optional) |
New in Anatomist 3.1 set the viewport bounding box (min part) in the window coordinates system. |
boundingbox_max | float_vector (optional) |
New in Anatomist 3.1 set the viewport bounding box (max part) in the window coordinates system. |
cursor_position | float_vector (optional) | set cursor position (and also slice plane position) (cf LinkedCursor) |
observer_position | float_vector (optional) | camera position (3 coords) |
slice_quaternion | float_vector (optional) | rotation of the oblique cut plane (4 normed components) |
slice_orientation | float_vector (optional) |
New in Anatomist 4.4 oblique cut plane orientation, as a normal vector (3 components) |
view_quaternion | float_vector (optional) | rotation (4 normed components) |
force_redraw | int (optional) | force redraw the view: by default views are only redrawn after a slight delay so as to only redraw once if several modifications are done. In "movie" mode, one wants to be sure that the image is correctly updated and saved. | zoom | float (optional) | zoom factor (1=normal) |
ChangePalette¶
Modifie une palette de la liste (panneau de gauche de la fenêtre de palettes)Attribute: | Type: | Description: |
---|---|---|
colors | int_vector | vecteurs de couleurs RGB (composantes à la suite) |
color_mode |
string (optionnel) |
"RGB" ou "RGBA" |
ClosePipe¶
Ferme le pipe de lecture sur lequel cette commande est envoyée - fermeture de la télécommande, en d'autres termes.Attribute: | Type: | Description: |
---|---|---|
remove_file | int | flag présisant si Anatomist doit effacer le fichier pipe nommé après fermeture |
CloseWindow¶
Ferme des fenêtresAttribute: | Type: | Description: |
---|---|---|
windows | int_vector |
ControlsParams¶
Ouvre ou ferme la fenête de paramètres ds contrôlesAttribute: | Type: | Description: |
---|---|---|
window | int | Fenêtre depuis laquelle les paramètres des contrôles doivent être ouverts |
show | int | 0: fermer, 1: ouvrir |
CreateControlWindow¶
Crée la fenêtre de contrôle. Comme c'est fait automatiquement dans l'appli, cette commande ne sert en fait à rien...CreateWindow¶
Opens a new Anatomist window.Attribute: | Type: | Description: | ||||||
---|---|---|---|---|---|---|---|---|
type | string | "Axial", "Sagittal", "Coronal", "3D", "Browser", "Profile" | ||||||
res_pointer | int | ID of the new window | ||||||
geometry | int_vector (optional) | position and size of the window: x, y, w, h | ||||||
block | int (optional) | New in Anatomist 3.0. Allows to insert the new window in
a "block" which may contain several views. By default (block=0),
the window will not be in any block. If block doesn't exist
anymore, a new block will be created, otherwise the window will be
added to an existing block. Note: The block number is an ID just like those of objects, windows etc.: a number already allocated must not be reused. |
||||||
block_columns | int (optional) |
New in Anatomist 3.1.
If block specifies a new block to be created, then it will have this number of columns. Default: 2, but see below. New in Anatomist 4.2: The default is 2, but if specified, it will force an existing block to resize at 2 columns, whereas if unspecified, the block will be left unchanged. |
||||||
block_rows | int (optional) |
New in Anatomist 4.2.
If block specifies a new block to be created, then it will have this number of rows. As for block_columns, the default is 2, but if specified, it will force an existing block to resize at 2 rows, whereas if unspecified, the block will be left unchanged. This option is incompatible with block_columns. If both are used, block_columns will override block_rows. |
||||||
options | dictionary (optional) | New in Anatomist 3.0. Additional options passed to the new window
upon creation. Some windows types may interpret some specific options. For instance: options { '__syntax__' : 'tree', 'no_decoration': 1 } At the moment, known options are:
|
DeleteAll¶
New in Anatomist 3.1.7Deletes all elements loaded in Anatomist (objects, windows, referentials, transformations).
No parameters.
DeleteElement¶
Détruit n'importe quel type d'élément anatomist connu (objets, fenêtres, référentiels)Attribute: | Type: | Description: |
---|---|---|
elements | int_vector |
DuplicateObject¶
New in Anatomist 3.1.Duplicates an existing object, doing a deep or shallow copy of it. Object duplication is especially useful when needing to assign severeal palettes/materials to a single data.
Objects copying is object-dependent and is not a mandatory feature of all object types: some objects may not be able to be copied. So this command may fail and do nothing. So it is better to check the result unless you exactly know which object you are duplicating. Check can be achieved via the ObjectInfo command on the res_pointer ID.
Attribute: | Type: | Description: |
---|---|---|
source | int | source object ID, to be duplicated |
res_pointer | int | ID of the copy object |
hidden | int (optional) | A hidden object does not appear in Anatomist main control window. |
shallow | int (optionnel) |
A shallow copy will try to share the same underlying low-level data (volume data block, mesh veretices/polygons etc), whereas a deep copy will try to duplicate everything. We say "try" here because the actual copy operation is object-dependent, may not be implemented at all and
so can fail. Default: 1 (actualy shallow) |
EventFilter¶
Active/désactive et règle le filtre d'événement sur le canal de sortie associé à ce canal de commandes (cf commande Outpout)Attribute: | Type: | Description: |
---|---|---|
filter |
string |
liste d'événements
à filtrer (c.a.d. à laiser voir si le filtrage par défaut
est actif, ou au contraire à ne pas voir si le filtrage par défaut
est inactif). filter est une liste de chaines séparées
par des espaces |
unfilter |
string |
liste d'événements
à ne plus filtrer: ceux-ci sont enlevés de la liste "filter"
précédente du filtre. |
default_filtering |
int (0 ou 1) |
Le filtrage par défaut
définit si le filtre fonctionne par "addition" ou par "soustraction".
En mode de filtrage par défaut actif (ce qui est le cas au démarrrage),
tous les événements sont filtrés par défaut
(c.a.d. invisibles), la liste "filter" permet de voir les événements
choisis (mode soustraction en quelque sorte). En mode de filtrage par défaut inactif, c'est l'inverse; tous les événements sont déclenchés sauf ceux donnés par la liste "filter" (mode addition). Si default_filtering est spécifié, le filtre est remis à zéro: listes de d'événements activés auparavant sont effacées. |
Exit¶
Sort d'AnatomistExportTexture¶
Extrait la texture d'un objet texturé et l'écrit sur disque sous forme de textureAttribute: | Type: | Description: |
---|---|---|
filename |
string |
fichier de texture à écrire |
object |
int |
objet dont on veut exporter la texture |
time |
float (optionnel) |
temps auquel on veut extraire la texture
(dans le cas d'objets temporels). Si time < 0 ou s'il n'est
pas précisé, tous les temps seront extraits, la texture écrite
sera temporelle (seuls le temps de la texture compte: par ex. une fusion
maillage temporel + texture fixe ne donnera qu'un seul instant) |
ExternalReference¶
New in Anatomist 3.1Manages reference counting inside Anatomist for objects, windows etc., allowing external applications (like BrainVisa) to use reference counting for their objects.
Warning: this command is reserved to experts and is highly dangerous since it can easily cause Anatomist to crash.
Attribute: | Type: | Description: |
---|---|---|
elements | int_vector | IDs of elements |
action_type | string |
specifies which of reference counting operation is to be performed:
|
ExtractTexture¶
New in Anatomist 3.0Extracts the texture of a textured object and maks a new texture object from it
Attribute: | Type: | Description: |
---|---|---|
object | int | object from which the texture has to be exported |
time | float (optional) | If provided on a time object, the texture will be extracted at the given time position. If time < 0 or if not provided, all timesteps will be extracted and the resulting texture will have several timesteps (only texture time is taken into account: for instance a fusion time mesh + still texture will lead to only one timestep). |
res_pointer | int (optional) | resulting texture |
Fusion2DParams¶
Règle les paramètres d'une fusion 2D. Cette commande est en grande partie obsolète à partir d'Anatomist 3.0. En fait, seul le paramètre reorder_objects a encore une utilité propre. Les autres paramètres sont maintenant dans la commande TexturingParams (puisqu'ils ne sont plus spécifiques aux fusions 2D).Attribute: | Type: | Description: |
---|---|---|
object | int | |
mode | string (optionnel) | linear, geometric ou linear_on_defined. This obsolete parameter is replaced by the one in TexturingParams, which supports many more modes. |
rate | float (optionnel) | taux de fusion (entre 0 et 1) |
reorder_objects | int_vector (optionnel) | numéros des objets dans le bon ordre |
Fusion3DParams¶
New in Anatomist 3.0
Sets texture mapping parameters for Fusion3D objects (mesh+volume)
Attribute: | Type: | Description: | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object | int | target object to change parameters on | ||||||||||||||
method | string (optional) | Spatial neighborhood calculation method:
|
||||||||||||||
sumbethod | string (optional) | Integration method in the specified neighborhood for each mesh vertex, in order to mix several voxels values in the neighborhood. Thus it is not relevant for point* methods.
|
||||||||||||||
depth | float (optional) | Integration neighborhood size, in mm. | ||||||||||||||
step | float (optional) | Integration sampling step, in mm. This parameter is now only used in sphere mode to downsample a sphere. In Anatomist 4.6, the line mode has changed to use one sample in each volume voxel on the line, using a rasterization method instead of a fixed step. |
FusionInfo¶
New in Anatomist 3.2.1Lists fusion types, either globally or those allowed for a given set of objects.
Information is returned in the same way as for GetInfo or ObjectInfo: a python dictionary.
If filename is not specified, information is written on the current output (see Output command).
Attribute: | Type: | Description: |
---|---|---|
objects | int_vector (optional) | objects to be fusioned. If not specified, the global list of fusion methods is output |
filename | string (optional) | file or "named pipe" in which Anatomist will write output informtaion in |
request_id | int (optional) | ID used in Anatomist answer to identify the request. this option is used or instance by BrainVisa to identify answers to its asynchronous requests, which are not necessarily processed in the order they were sent in a multi-threaded context. |
FusionObjects¶
Crée un objet fusion à partir de plusieurs autresAttribute: | Type: | Description: |
---|---|---|
objects | int_vector | |
res_pointer | int | ID de l'objet fusion nouvellement crée |
method | string | méthode de fusion utilisée |
GenerateTexture¶
Nouveau dans Anatomist 3.0Génère une texture vierge (valeur 0 partout) correspondant à un objet maillé (maillage, bucket...). La texture sera créée en mode "auto-généré" (c'est à dire que les valeurs seront générées par OpenGL à l'affichage, voir TexturingParams)
Attribute: | Type: | Description: |
---|---|---|
object |
int (optionnel) |
objet sur lequel on construit la texture. S'il n'est pas donné, la texture n'aura qu'un seul point et ne sera utilisable qu'en mode "généré par OpenGL". |
dimension | int (optionnel) | dimension de la texture: 1 ou 2. Défaut: 1 |
res_pointer (optionnel) |
int (optionnel) |
objet résultat |
GetInfo¶
Demande à Anatomist des informations sur l'état de l'application (objets, fenêtres, ...).Les informations sont données entre accolades sous forme de dictionnaire python (directement utilisable par un interpréteur python).
Pour obtenir des infos précises sur des objets ou fenêtres, utiliser la commande ObjectInfo.
Si filename n'est pas précisé, les informations sont écrites sur la sortie courante (réglable avec la commande Output)
Attribute: | Type: | Description: |
---|---|---|
aims_info | int (bool) (optionnel) | Nouveau dans Anatomist 3.1 donne des informations sur la librairie AIMS (texte non structuré) |
filename | string (optionnel) | fichier ou du "pipe nommé" dans lequel Anatomist écrit les informations demandées |
linkcursor_lastpos |
int (bool) (optionnel) |
donne la dernière position cliquée
pour le curseur lié (tous groupes confondus), dans le repère
donné par le paramètre linkcursor_referential s'il
est précisé |
linkcursor_referential |
int (optionnel) |
repère dans lequel la position du curseur
lié doit être donnée (utilse seulement avec le paramètre
linkcursor_lastpos). S'il n'est pas précisé,
le "repère central" d'anatomist est utilisé |
list_commands | int (bool) (optionnel) | Nouveau dans Anatomist 3.1 donne la liste des commandes connues par Anatomist, et leurs paramètres |
modules_info | int (bool) (optionnel) | Nouveau dans Anatomist 3.1 donne la liste des modules et leur description |
name_objects |
string (optionnel) |
Permet de donner des noms (id)
aux objets qui n'en ont pas dans le contexte courant. "top": assigne des noms aux objets "toplevel" seulement (ceux qui n'ont pas de parent). "all", "yes", "1": assigne des noms à tous les objets contenus dans Anatomist |
name_referentials |
int (bool) (optionnel) |
Nouveau dans Anatomist 3.0 assigne des noms (id) aux référentiels qui n'en ont pas dans le contexte courant |
name_transformations |
int (bool) (optionnel) |
Nouveau dans Anatomist 3.0 assigne des noms (id) aux transformations qui n'en ont pas dans le contexte courant |
name_windows |
int (bool) (optionnel) |
assigne des noms (id) aux fenêtres qui n'en ont pas dans le contexte courant |
objects | int (bool) (optionnel) | demande la liste des ID des objets concernant le canal de communication courant |
palettes | int (bool) (optionnel) | demande la liste des palettes (noms) |
referentials | int (bool) (optionnel) | demande la liste des référentiels |
request_id | string (optionnel) | Nouveau dans Anatomist 3.0.3 ID utilisé dans la réponse d'Anatomist pour identifier la requête. Cette option est utilisée par exemple par BrainVisa pour identifier les réponses à ses requêtes, qui ne sont pas nécéssairement traitées dans le bon ordre dans un contexte "multi-threadé" |
selections |
int (bool) (optionnel) |
donne les listes d'objets sélectionnés (par groupe) |
transformations | int (bool) (optionnel) | demande la liste des transformations |
version | int (bool) (optionnel) | Nouveau dans Anatomist 3.1 demande la version d'Anatomist |
windows | int (bool) (optionnel) | demande la liste des ID des fenêtres |
GraphDisplayProperties¶
New in Anatomist 3.0.2Sets per-graph display properties. This allows to display a numeric property value using a colormap, or select name/label identification modes.
Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | target graphs |
display_mode | string (optional) | "Normal" or "PropertyMap" |
display_property | string (optional) | name of the property to display in PropertyMap mode |
property_mask | int (optional) | New in Anatomist 3.1.7 bitwise combination of: 1: nodes, 2: relations, to set if the property should be displayed from nodes/relations values |
nomenclature_property | string (optional) | New in Anatomist 3.1.7 "name" or "label", forces the nomenclature label property for the given graphs. To get back to the default global settings (see GraphParams for global settings), use the value "default". |
GraphParams¶
Change les options globales relatives aux graphes et aux sélectionsAttribute: | Type: | Description: |
---|---|---|
display_mode |
string (optionnel) |
Mode d'affichage des sous-objets contenus dans les noeuds de graphes: "mesh", "bucket", "all ", "first" |
label_attribute |
string (optionnel) |
Attribut des noeuds de graphes utilisé comme filtre de sélection, généralement "label" ou "name" |
save_only_modified |
int (optionnel) |
La sauvegarde d'un graphe sauve soit tous les sous-objets, soit essaie de ne sauver que ceux qui ont été modifiés (si le graphe est réécrit et pas déplacé) |
saving_mode |
string (optionnel) |
Mode de sauvegarde: "unchanged" (comme il a été lu), "global" (1 fichier pour tous les sous-objets de la même catégorie), ou "local" (1 fichier par sous-objet) |
selection_color |
int_vector (optionnel) |
Couleur de sélection, sous la forme R G B [A [nA]], où A est l'opacité et NA (0 ou 1) est un booléen qui précise si l'opacité s'applique ou si on utilise celle de l'objet sélectionné. |
selection_color_inverse |
int (optionnel) |
booléen, s'il est mis, la sélection inverse les couleurs plutôt que d'utiliser une couleur fixe |
set_base_directory |
int (optionnel) |
booléen, s'il est mis les sous-objets d'un graphe sont sauvés dans un répertoire qui porte le même nom qui lui, avec l'extension ".data". Sinon l'ancien nom est gardé même si on change le nom du graphe |
show_tooltips |
int (optionnel) |
Active ou invalide l'affichage des bulles qui indiquent les noms des noeuds de graphes dans les fenêtres 2D/3D |
use_hierarchy | int (optionnel) | déprécié depuis Anatomist 3.0: utilisez use_nomenclature maintenant. |
use_nomenclature | int (optionnel) |
Nouveau dans Anatomist 3.0. Active ou invalide la colorisation des graphes en fonction de la nomenclature |
GroupObjects¶
Crée une liste d'objets (groupe simple)Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | |
res_pointer | int | ID de l'objet groupe nouvellement créé |
LinkedCursor¶
Déplace le curseur lié sur les fenêtres du même groupeAttribute: | Type: | Description: |
---|---|---|
window | int | fenêtre déclenchant l'action |
position | float_vector | position 3D ou 4D |
LinkWindows¶
Lie les fenêtres en un groupeAttribute: | Type: | Description: |
---|---|---|
windows | int_vector | fenêtres à lier |
group | int (optionnel) | Nouveau dans Anatomist 3.1. Numéro du groupe. -1 (défaut) signifie un nouveau groupe. On peut réutiliser un groupe existant. |
LoadGraphSubObjects¶
Loads graph elements which may be not still in memory, like visualizable objects in relations.Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | graphs to be completed |
objects_mask | int | bitwise combination of codes which indicate which graphe elements should be loaded: 1 (nodes), 2 (relations). |
LoadObject¶
Loads an object from a file on diskAttribute: | Type: | Description: | ||||||
---|---|---|---|---|---|---|---|---|
filename | string | file to read the object from (volume, mesh etc.) | ||||||
res_pointer | int | ID of the loaded object | ||||||
as_cursor | int (optional) | New in Anatomist 3.0. If this flag is set, the object will not be included in the "regular" objects list, but will be useable as a cursor in 3D views. | ||||||
options | dictionary (optionnel) | New in Anatomist 3.0.
Additional options to be passes to reading functions. At the moment, only one option is recognized at anatomist level (but in the future, more options could be interpreted by reading functions for specific objects or formats):
|
LoadReferentialFromHeader¶
Renamed in Anatomist 4.2
This command was formerly named ApplyBuiltinReferential. It has been renamed for clarity. An alias is still available under the older name.
New in Anatomist 4.0
Extracts referentials / transformations from objects headers when they contain such information, and assign them.
Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | IDs of objects |
LoadTransformation¶
Initialise une transformation entre deux référentiels, soit à partir d'un fichier disque (matrice de translation et rotation, format ASCII), soit avec une matrice donnée directement.Il faut préciser soit le nom de fichier, soit la matrice de transformation. Si les deux sont donnés, seul le fichier est pris en compte.
Attribute: | Type: | Description: |
---|---|---|
origin | int |
Optionnel depuis Anatomist 3.1 ID du référentiel de départ Lorsqu'il n'est pas précisé, il peut être donné par le fichier associé. S'il n'y a pas de fichier associé, ou qu'il ne contient pas d'information d'origine, alors un nouveau repère est créé. |
destination | int |
Optionnel depuis Anatomist 3.1 ID du référentiel d'arrivée Comme pour l'origine, le référentiel peut être donné par le fichier associé, ou créé à la volée. |
filename | string (optionnel) | nom du fichier de transformation |
matrix | float_vector (optionnel) | matrice de transformation: elle doit avoir 12 éléments à la suite (représentant 4 lignes de 3 colonnes). La 1ère ligne est la translation, le reste la matrice de rotation (même format que les fichiers) |
res_pointer | int | ID de la transformation résultante |
NewId¶
New in Anatomist 3.0.2Generates new free ID numbers for objects and writes them to the current output stream.
Attribute: | Type: | Description: |
---|---|---|
num_ids | int (optional) | number of IDs to generate (default: 1) |
request_id | string (optional) | New in Anatomist 3.0.3 ID attribute that is used in Anatomist answer to identify the request. This feature is used for instance by BrainVisa to identify its requests that are not necessarily processed in the right order in a multi-threaded environment |
NewPalette¶
Ajoute une nouvelle palette vierge dans la liste des palettes (liste de gauche dans les fenêtres de palettes). Contrairement aux autres éléments d'Anatomist, les palettes ne sont pas identifiées par un numéro mais par leur nom.Attribute: | Type: | Description: |
---|---|---|
name | string | nom donné à la nouvelle palette |
ObjectInfo¶
Décrit aussi précisément que possible les éléments donnés par leur ID. Il peut s'agir d'objets anatomist, de fenêtres, de référentiels, de transformations, ...La description est faite sous forme de dictionnaire python.
Si filename n'est pas précisé, les informations sont écrites sur la sortie courante (réglable avec la commande Output)
Attribute: | Type: | Description: |
---|---|---|
filename | string (optionnel) | fichier ou "pipe nommé" dans lequel Anatomist écrit les informations |
objects | int_vector | IDs des éléments à décrire |
name_children | int (optionnel) | si ce flag est non-nul, un ID est assigné à chaque sous-objet qui n'en a pas |
name_referentials | int (optionnel) | si ce flag est non-nul, un ID est assigné à chaque reférentiel qui n'en a pas et qui est cité par les infos |
request_id | string (optionnel) | Nouveau dans Anatomist 3.0.3 ID utilisé dans la réponse d'Anatomist pour identifier la requête. Cette option est utilisée par exemple par BrainVisa pour identifier les réponses à ses requêtes, qui ne sont pas nécéssairement traitées dans le bon ordre dans un contexte "multi-threadé" |
Output¶
Ouvre un "flux" de sortie, soit par un nom de fichier, soit par une connexion réseau TCP/IP (adresse internet + port)Attribute: | Type: | Description: |
---|---|---|
filename | string (optionnel) | fichier ou "pipe nommé" |
ip | string (optionnel) | adresse tcp/ip réseau de la machine à contacter |
port | int (optionnel) | port tcp/ip sur lequel se connecter par réseau |
default_context | int (optionnel) | indique s'il faut changer la sortie du contexte par défaut plutôt que le contexte courant |
PopupPalette¶
Ouvre une fenêtre de réglage de palette pour les objets donnésAttribute: | Type: | Description: |
---|---|---|
objects | int_vector |
ReloadObject¶
Recharge des objets déjà en mémoire à partir de leurs fichiers disque (s'ils ont changé). Attention, ça ne marche pas pour tous les objets.Attribute: | Type: | Description: |
---|---|---|
objects | int_vector |
RemoveObject¶
Removes objects from windowsAttribute: | Type: | Description: |
---|---|---|
objects | int_vector | IDs of objects to be removed from specified windows |
windows | int_vector | IDs of windows |
remove_children | int (optional) |
New in Anatomist 3.2.1 Also remove the given objects children (useful for graphs for instance) Changed in Anatomist 4.2: The value is now a tristate (-1, 0, 1), -1 being the default and meaning that the behaviour is object dependent: true for graphs, and false for other objects types, mainly. This makes the use of this parameter unneeded most of the time. |
SaveObject¶
Sauvegarde un objet sur disqueAttribute: | Type: | Description: |
---|---|---|
object | int | |
filename | string (optionnel) | s'il n'est pas donné, l'ancien nom de fichier de l'objet est utilisé |
SaveTransformation¶
Ecrit un fichier de transformationAttribute: | Type: | Description: |
---|---|---|
filename |
string |
nom du fichier à écrire |
transformation |
int |
ID de la transformation |
Select¶
Sélectionne et/ou désélectionne des objetsAttribute: | Type: | Description: |
---|---|---|
objects | int_vector (optionnel) | objets à sélectionner |
unselect_objects | int_vector (optionnel) | objets à dé-sélectionner |
group | int (optionnel) | groupe de sélection concerné - par défaut, 0 |
modifiers | string (optionnel) | attributs de la sélection: set, add ou toggle. Par défaut le mode est set si unselect_objects est vide, et add sinon. |
SelectByHierarchy¶
Déprécié à partir d'Anatomist 3.0: cette commande est renommée SelectByNomenclature.SelectByNomenclature¶
Nouveau dans Anatomist 3.0 et remplace SelectByHierarchy.Sélectionne par une nomenclature (action correspondant à un click sur une nomenclature dans un browser)
Attribute: | Type: | Description: |
---|---|---|
nomenclature | int | Nouveau dans Anatomist 3.0. nomenclature à utiliser pour la sélection |
hierarchy | int | déprécié à partir d'Anatomist 3.0: remplacé par nomenclature |
names | string | liste des éléments de la nomenclature à sélectionner. Pour le moment on utilise l'espace pour séparer les noms (ce qui signifie qu'on ne peur pas mettre d'espaces dans les noms) |
group | int (optionnel) | groupe de fenêtres concerné |
modifiers | string (optionnel) | comme pour la commande Select Nouveau dans la version 1.30b (corrigée): nouveau mode "remove", qui permet d'enlever les noeuds concernés des fenêtres concernées pour les faire disparaître. |
Server¶
Passe Anatomist en mode serveur. Dans ce mode, Anatomist écoute les connexions réseau. Chaque connexion est une source de commandes indépendante.Attribute: | Type: | Description: |
---|---|---|
port |
int |
port TCP à écouter |
SetControl¶
Fixe le contrôle actif sur les fenêtres donnéesAttribute: | Type: | Description: |
---|---|---|
windows | int_vector | |
control | string |
SetMaterial¶
Sets some or all of the object material properties.Since Anatomist 3.0, these properties also include 3D rendering modes that are specifically set on the object
Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | IDs of objects to set material on |
ambient | float_vector (optional) | RGBA values of the ambiant component of the material (4 values). Negative values are left unchanged (old values are kept) |
diffuse | float_vector (optional) | RGBA |
emission | float_vector (optionnel) | RGBA |
specular | float_vector (optional) | RGBA |
shininess | float (optional) | range 0-124, a negative value doesn't produce any change |
refresh | int (optional) | forces refresh the windows showing the appropriate objects |
ghost | int (optional) | New in Anatomist 4.4 A ghost object is not selectable. obsoleted in version 4.5, replaced by the selectable_mode property. |
lighting | int (optional) | New in Anatomist 3.0 enables (1) or disables (0) objects lighting/shading. Setting this value to -1 goes back to the default mode (globally set at the view/scene level) |
smooth_shading | int (optional) | New in Anatomist 3.0 (0/1/-1) smooth or flat polygons mode |
polygon_filtering | int (optional) | New in Anatomist 3.0 (0/1/-1) filtering (antialiasing) of lines/polygons |
depth_buffer | int (optional) | New in Anatomist 3.0 (0/1/-1) enables/disables writing in the Z-buffer. You can disable it if you want to click "through" an object (but it may have strange effects on the rendering) |
face_culling | int (optional) | New in Anatomist 3.0 (0/1/-1) don't draw polygons seen from the back side. The best is to enable it for transparent objects, and to disable it for "open" (on which both sides may be seen) and opaque meshes. For objects both open and transparent, there is no perfoect setting... |
front_face | string (optional) | New in Anatomist 4.3 Set the external face of polygons (as in OpenGL): "clockwise", "counterclockwise" or "neutral"(default). Normally in Aims/Anatomist indirect referentials are used, so polygons are in clockwise orientation. |
line_width | float (optional) | New in Anatomist 3.1.4 Lines thickness (meshes, segments, wireframe rendering modes). A null or negative value fallsback to default (1 in principle). |
polygon_mode | string (optional) | New in Anatomist 3.0 polygons rendering mode: "normal", "wireframe", "outline" (normal + wireframe), "hiddenface_wireframe" (wireframe with hidden faces), or "default" (use the global view settings) New in Anatomist 3.1.5: "ext_outlined" (thickened external boundaries + normal rendering). |
selectable_mode | string (optional) | New in Anatomist 4.5 Replaces the ghost property. always_selectable: object is selecatble whatever its opacity. ghost: object is not selectable. selectable_when_opaque: object is selectable when totally opaque (this is the default in Anatomist). selectable_when_not_totally_transparent: object is selectable unless opacity is zero. |
unlit_color | float_vector (optional) | New in Anatomist 3.1.4 color used for lines when lighting is off. For now it only affects polygons boundaries in "outlined" or "ext_outlined" polygon modes. |
SetObjectPalette¶
Affecte une palette à des objets. Les paramètres (tous optionnels) permettent de régler le mode d'utilisation de la palette par les objets.Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | |
palette | string (optionnel depuis la version 3.2) | nom de la palette principale à appliquer |
palette2 | string (optionnel) | palette secondaire (utile uniquement dans le cas de textures 2D) |
min | float (optionnel) | proportion min de la palette correspondant au min des valeurs de la texture de l'objet associées |
max | float (optionnel) | pareil pour le max. min max peuvent être négatifs (utilisation d'une sous-partie de lapalette) et max peut être supérieur à min (->palette inversée) |
min2 | float (optionnel) | pareil pour l'affectation de la 2ème palette sur la 2ème composante de texture (objets avec texture 2D) |
max2 | float (optionnel) | idem |
mixMethod | string (optionnel) | Mode de mélange des 2 palettes pour former une palette 2D: "LINEAR" ou "GEOMETRIC" pour le moment |
linMixFactor | float (optionnel) | facteur de mélange entre les 2 palettes en mode linéaire |
palette1Dmapping | string (optionnel) | Mode de parcours d'une palette 2D (image) pour une texture 1D: FirstLine (1ère ligne de l'image) ou Diagonal |
absoluteMode | int (optionnel) | Nouveau dans Anatomist 3.1.4 Si ce flag est non-nul, les valeurs min, max, min2 et max2 sont des valeurs absolues dans la texture des objets concernés. Sinon (par défaut) on est en mode proportionnel. |
sizex | int (optionnel) | Nouveau dans Anatomist 3.2 Taille X de la palette/texture interne utilisée par OpenGL. Ce paramètre peut être utile pour avoir une bonne précision de texture sur certains objets. |
sizey | int (optionnel) | Nouveau dans Anatomist 3.2 Taille Y de la palette/texture interne utilisée par OpenGL. Ce paramètre peut être utile pour avoir une bonne précision de texture sur certains objets. |
zero_centered_axis1 | int (optionnel) | New in Anatomist 4.6 If activated (1), the palette will be centered to absolute value 0 when min/max are manipulated. Note that it doesn't force symmetry when setting min/max by a program, and the center is related to object extremal values. |
zero_centered_axis2 | int (optionnel) | New in Anatomist 4.6 If activated (1), the 2nd palette will be centered to absolute value 0 when min/max are manipulated. Note that it doesn't force symmetry when setting min/max by a program, and the center is related to object extremal values. |
ShowObject¶
New in Anatomist 3.1.Shows an object in Anatomist main window if it was hidden previously. This command is merely useful at user level and is generally only used within scripts.
Attribute: | Type: | Description: |
---|---|---|
object | int | object ID |
SliceParams¶
New in Anatomist 3.0.1Sets slice parameters on "self-sliceable" objects: Anatomist objects which have a slice information within themselves, like Slice objects, or CutPlane objects.
Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | IDs of the target objects |
position | float_vector (optional) | Any point of the slice plane |
quaternion | float_vector (optional) | Quaternion specifying the orientation of the slice plane |
plane | float_vector (optional) | Alternative to position + quaternion: the plane orientation can be specified as a plane equation. |
TexturingParams¶
New in Anatomist 3.0Sets texture mapping parameters
Attribute: | Type: | Description: |
---|---|---|
objects | int_vector | target objects to change parameters on |
texture_index | int (optional) | texture number (for objects with several textures), default: 0 |
mode | string (optional) | textures color mixing mode: geometric,
linear, replace, decal, blend,
add, combine, or linear_on_defined. These values correspond both to OpenGL texture mapping functions, and also to fusion modes (for 2D fusions objects) (see also rate). New in Anatomist 4.3: A bunch of new fusions mixing modes have appeared, allowing to perform various masking modes for instance: linear_A_if_A_white, linear_A_if_B_white (synonim to linear_on_defined), linear_A_if_A_black, linear_A_if_B_black, linear_A_if_A_opaque, linear_A_if_B_transparent, linear_B_if_B_opaque, linear_B_if_A_transparent, max_channel, min_channel, max_opacity, min_opacity. New in Anatomist 4.4: New mixing modes: geometric_lighten (geometric mixing of (1 - colors)), geometric_sqrt: formerly geometric mode, but the geometric mode now does not "normalize" the multiplication by a square root. |
filtering | string (optional) | texture filtering: nearest (default) or linear |
generation | string (optional) | texture generation mode (textures automatically generated by OpenGL completely replace the current texture: thus this option has no real interest but looks nice): none (default), object_linear, eye_linear, sphere_map, reflection_map, normal_map. (these values directly correspond to OpenGL functions) |
generation_params_1 | float_vector (optional) | Parameters associated to texture generation for the first texture coordinate. Such parameters are only useful when in object_linear or eye_linear mode. It is a 4 float vector defining the direction of the projection of the first texture coordinate according to real 3D coordinates in the mesh. Parameters specified here only affect the current generation mode (the one given by the generation parameter, or the mode currently in use if generation is not specified). |
generation_params_2 | float_vector (optional) | Parameters associated to texture generation for the second texture coordinate. |
generation_params_3 | float_vector (optional) | Parameters associated to texture generation for the third texture coordinate. For now 3D textures are not supported, so this parameter is useless. |
rate | float (optional) | mixing rate for textures, in modes supporting it (linear-based modes for instance) (object - texture weighting). This parameter has no effect for some objects. |
interpolation | string (optional) | colors interpolation space on textures: palette (default) or rgb. |
value_interpolation | int (optional) | New in Anatomist 4.6.2. Enables (1) or disables (0) values interpolation during resampling operations. It is currently only used in scalar volumes. Default is 1. |
WindowBlock¶
New in Anatomist 4.2.Opens or configures a windows block, a widget that contains a grid of anatomist windows.
Attribute: | Type: | Description: |
---|---|---|
block | int | ID of the (existing or future) window block. If block doesn't exist, a new block will be created, otherwise the existing one will be modified. Note: The block number is an ID just like those of objects, windows etc.: a number already allocated must not be reused. |
geometry | int_vector (optional) | position and size of the window: x, y, w, h |
block_columns | int (optional) | Set the number of columns. The default is 2, but if specified, it will force an existing block to resize at 2 columns, whereas if unspecified, the block will be left unchanged. |
block_rows | int (optional) |
Set the number of rows. As for block_columns, the default is 2, but if specified, it will force an existing block to resize at 2 rows, whereas if unspecified, the block will be left unchanged. This option is incompatible with block_columns. If both are used, block_columns will override block_rows. |
make_rectangle | int (optional) | if non-null, the block will be reorganized to fit a rectangular grid with the specified width / height ratio with all its current anatomist windows. |
rectangle_ratio | float (optional) | if make_rectangle is set, this parameter specifies the width / height ratio of the rectangle. Default: 1. |
WindowConfig¶
Settings for windows (includes various settings)Attribute: | Type: | Description: |
---|---|---|
windows | int_vector (optional) | selected windows |
clipping | int (optional) | number of clipping planes: 0, 1 or 2 |
clip_distance | float (optional) | distance between the slice plane and the clipping planes |
cursor_visibility | int (optional) | New in Anatomist 3.1. makes visible (1) or invisible (0) the linked cursor in the chosen windows. The value -1 sets back the global setting (of the preferences) |
face_culling | int (optional) | enables (1) or disables (0) the elimination of polygons seen from the bottom face |
flat_shading | int (optional) | enables (1) or disables (0) rendering in "flat shading" mode (without color smoothing) |
fog | int (optional) | enables (1) or disables (0) fog |
geometry | int_vector (optional) | position and size of the window (external size). If sizes are zero or not specified, the current window size is not changed |
iconify | int (optional) | iconifies (or hides) windows |
light | object (optional) | New in Anatomist 3.2.1.
Windows lighting settings. This dictionary may include the following parameters:
|
linkedcursor_on_slider_change | int (optional) | New in Anatomist 3.0. enables or disables the mode when slice/time sliders act as linked cursor actions (with propagation to other views) |
perspective | int (optional) | enables (1) or disables (0) the perspective rendering mode |
perspective_angle | float (optional) | New in Anatomist 4.6. set the perspective view angle (low: more isometric, high: more distorted). Only used when perspective is enabled. |
perspective_auto_far_plane | int (optional) | New in Anatomist 4.6. enables (1) or disables (0) the automatic perspective far clipping plane setup. Only used when perspective is enabled. |
perspective_far_distance | float (optional) | New in Anatomist 4.6. set the clipping distance from the eye. Only used when perspective is enabled and perspective_auto_far_plane is disabled. |
perspective_near_ratio | float (optional) | New in Anatomist 4.6. set the minimum ratio between the near clipping plane distance and the far one. Objects nearer than this near plane will not be displayed. But reducing this ratio lowers the precision of the depth buffer. Default is 0.01. Only used when perspective is enabled. |
polygon_filtering | int (optional) | enables (1) or disables (0) polygons and lines smoothing (anti-aliasing) |
polygon_mode | string (optional) | polygons rendering mode: "normal", "wireframe", "outline" (normal + wireframe), "hiddenface_wireframe" (wireframe with hidden faces) |
polygons_depth_sorting | int (optional) | New in Anatomist 4.5. enables (1) or disables (0) polygons sortig along depth on transparent objects to allow a better rendering. This mode has a large impact on performances, so use it with care. |
raise | int (optional) | unicognifies windows and make them move to the top of the desktop |
record_basename | string (optional) | base filename of images written using the film recording mode (ex: /tmp/toto.jpg). Images will actually have numbers appended before the extension |
record_mode | int (optional) | enables (1) or disables (0) the images recording mode (film) of 3D windows. To enable it, record_basename must also be specified |
snapshot | string (optional) | New in Anatomist 3.0. Saves the image of the view in the specified file. If windows contains several values, then several images have to be saved: in this case, snapshot is a list of filenames separated by space characters: so the file name/path must not contain any space character (this restriction doesn't apply if a single window is used). Node: escape character ("\ ") are not supported yet. |
transparent_depth_buffer | int (optional) | enables (1) or disables (0) writing of transparent objects in the depth buffer. Useful if you want to click across transparents objects (but the rendering can be wrong) |
view_size | int_vector (optional) | size of the rendering zone (3D rendering widget). This parameter has a higher priority than sizes given using geometry if both are specified |
fullscreen | int (optional) | New in Anatomist 3.1. enables or disables the fullscreen mode |
show_cursor_position | int (optional) | New in Anatomist 3.1. shows or hides the status bar at the bottom of the window, showing the cursor position and a current object value at this position. |
show_toolbars | int (optional) | New in Anatomist 3.1. shows or hides everything around the 3D view (menus, buttons bars, status bar, referential...) |
snapshot_width | int (optional) | New in Anatomist 4.6. Snapshot or recorded images width. If unspecified, fit the window size. |
snapshot_height | int (optional) | New in Anatomist 4.6. Snapshot or recorded images height. If unspecified, fit the window size. |
Commands defined in plugins¶
- ROI module
AddNode¶
Ajoute un noeud dans un graphe, avec éventuellement un bucket vide à l'intérieurAttribute: | Type: | Description: |
---|---|---|
graph | int | graphe auquel on ajoute un noeud |
res_pointer | int | ID du nouveau noeud créé |
name | string (optionnel) | nom de l'objet noeud défaut: RoiArg |
syntax | string (optionnel) | attribut syntaxique du noeud défaut: roi |
with_bucket | int (optionnel) | précise s'il faut créer un bucket dans le noeud défaut: oui |
res_bucket | int (optionnel) | ID du bucket crée (s'il est crée) |
no_duplicate | int (optionnel) | si mis à 1, empêche de recréer des noeuds qui ont le même attribut "name". Défaut: 0 |
CreateGraph¶
Crée un graphe associé à un objet 2D (par ex. un volume). L'objet de départ donne ses dimensions (taille de voxel, extrêma) au nouveau graphe.Attribute: | Type: | Description: |
---|---|---|
object | int | objet 2D servant de "modèle" au graphe |
res_pointer | int | ID du nouveau graphe créé |
name | string (optionnel) | nom de l'objet graphe. Défaut: RoiArg. |
filename | string (optionnel) | Nouveau dans Anatomist 3.1.4 nom de fichier associé au graphe. Défaut: aucun. |
syntax | string (optionnel) | attribut syntaxique du graphe. Défaut: RoiArg. |
PaintParams¶
New in Anatomist 4.2.0Sets various ROI painting parameters.
Attribute: | Type: | Description: |
---|---|---|
brush_size | float (optional) | Radius of the paint brush, in millimeters or in voxels, depending on the millimeter mode |
brush_type | float (optional) | "point", "square", "disk", or "sphere". "ball" is an alias for sphere. |
follow_linked_cursor | int (bool) (optional) | Linked cursor moving with brush |
line_mode | int (bool) (optional) | line interpolation mode between brush strokes |
millimeter_mode | int (bool) (optional) | brush size can be either in mm or in voxels. In voxels mode, the brush may be anisotropic. |
replace_mode | int (bool) (optional) | region replacing mode (when drawing on a different region) |