Облако тегов

Авторизация


Полезная информация

Холодильники Indesit на Avito: холодильники Indesit. . замена матрицы toshiba . Рекламное агентство Николаев
Телеконференции, научные статьи, исследования в медицине, биологии и экологии
 
 

Макрос 3Dflight

Печать E-mail
Автор Команда bioinformatix.ru   
25.04.2009 г.

Автор макроса:  Jerome Mutterer

Макрос 3D flight и его функции используются в скрипте для плагина Volume (Kai Barthel's)

Текст макроса: 

var display_mode, axes, markers, lut, scale,  zaspect, dist, depth, thresh, angle_x, angle_z, arguments, stack2;

macro "3Dflight" {
    requires("1.33r");

    // example
    run("MRI Stack (528K)");

    saveSettings();
    stack1 = getImageID;
    if (nSlices==1) exit("Stack required");
    setBatchMode(true);
    fly (2.5,90,0,5);
    for (dist =-110; dist <0; dist=dist+20)
        addview(1);
 
    setSlice(1);
    setBatchMode(false);
    restoreSettings();
    print (arguments);

    // start animation
    run("Animation Options...", "speed=3 start");
}


// functions implemented here (функция внедрения)

function addview(frames) {
    arguments="";
    arguments=arguments+" display_mode="+ display_mode;
    arguments=arguments+" markers="+ markers;
    arguments=arguments+" lut="+ lut;
    arguments=arguments+" axes="+ axes;
    arguments=arguments+" scale="+ scale;
    arguments=arguments+" z-aspect="+ zaspect;
    arguments=arguments+" dist="+ dist;
    arguments=arguments+" depth="+ depth;
    arguments=arguments+" thresh="+ thresh;
    arguments=arguments+" angle_x="+ angle_x;
    arguments=arguments+" angle_z="+ angle_z;
    // print (arguments);
    selectImage(stack1);
    run("Volume Viewer", arguments );
    run("Copy");
    w = getWidth; h = getHeight;
    close();     
    for (i=0;i<frames; i++) {
    if (stack2==0) {
        run("New...", "name=Plots type=RGB Color width="+w+" height="+h+" slices=1");
        stack2 = getImageID;
    } else {
        selectImage(stack2);
            run("Add Slice");
    }
    run("Paste");
    }
}

function fly(sc,ax,az,frames) {
    s_step= ((sc-scale)/frames);
    x_step= ((ax-angle_x)/frames);
    z_step= ((az-angle_z)/frames);
    for (i=0;i<frames; i++) {
        scale = scale + s_step;
        angle_x= angle_x+ x_step;
        angle_z= angle_z+ z_step;
        addview(1);
    }
}

function resetview() {
    display_mode=5;
    axes=0;
    markers=0;
    lut=0;
    scale=1;
    zaspect=4;
    dist=-300;
    depth=6;
    thresh=40;
    angle_x=110;
    angle_z=110;
}

// addview(frames); добавляет специфический номер в слой
// resetview(); делает все настройки по умолчанию
// fly(sc,ax,az,n); подсчитывает n слоев в позициях sc, ax, az

Последнее обновление ( 25.04.2009 г. )
 
« Пред.   След. »
 
 
Научно-информационный портал. Биоинформатика, геномика, протеомика. Биософт. Анализ изображений (Imaging). Copyright © 2008-2010
Rambler's Top100 создание сайтов, разработка сайтов