Ejemplo n.º 1
0
Dummy::Dummy(void)
{
	configurePluginInfo(getPluginTitle(),
						getPluginVersion(),
						getPluginAuthor(),
						getPluginDescription(),

						GlobalAttributes::PLUGINS_DIR +
						GlobalAttributes::DIR_SEPARATOR +
						QString("dummy") +
						GlobalAttributes::DIR_SEPARATOR + QString("dummy.png"));
}
Ejemplo n.º 2
0
PluginLoadReturn load1Plugin ( std::string plugin, std::string config )
{
	int (*lpProc)(const char*,void*);

	std::string realPluginName = findPlugin(plugin);

	if (pluginExists(realPluginName))
	{
		printf("LoadPlugin fialed:%s is already loaded\n",realPluginName.c_str());
		return eLoadFailedDupe;
	}

	void *hLib = dlopen(realPluginName.c_str(), RTLD_LAZY | RTLD_GLOBAL);
	if (hLib)
	{
		if (dlsym(hLib, "bzwb_Load") == NULL) {
			printf("Plugin:%s found but does not contain bzwb_Load method, error %s\n",plugin.c_str(),dlerror());
			dlclose(hLib);
			return eLoadFailedError;
		}

		int version = getPluginVersion(hLib);
		if (version < BZWB_API_VERSION)
		{
			printf("Plugin:%s found but expects an older API version (%d), upgrade it\n", plugin.c_str(), version);
			dlclose(hLib);
			return eLoadFailedError;
		}
		else
		{
			lpProc = reinterpret_cast<int (*)(const char*,void*)>(dlsym(hLib,"bzwb_Load"));
			if (lpProc)
			{
				(*lpProc)(config.c_str(),hLib);
				printf("Plugin:%s loaded\n",plugin.c_str());
				trPluginRecord pluginRecord;
				pluginRecord.handle = hLib;
				pluginRecord.plugin = plugin;
				vPluginList.push_back(pluginRecord);
				return eLoadComplete;
			}
		}
	}
	else
	{
		printf("Plugin:%s not found, error %s\n",plugin.c_str(), dlerror());
		return eLoadFailedError;
	}

	printf("If you see this, there is something terribly wrong.\n");
	return eLoadFailedError;
}
Ejemplo n.º 3
0
PluginLoadReturn load1Plugin ( std::string plugin, std::string config )
{
	int (*lpProc)(const char*,void*);

	std::string realPluginName = findPlugin(plugin);
	if (pluginExists(realPluginName))
	{
		printf("LoadPlugin fialed:%s is already loaded\n",realPluginName.c_str());
		return eLoadFailedDupe;
	}

	HINSTANCE	hLib = LoadLibraryA(realPluginName.c_str());
	if (hLib)
	{
		if (getPluginVersion(hLib) > BZWB_API_VERSION)
		{
			printf("Plugin:%s found but expects an newer API version (%d), upgrade your application\n",plugin.c_str(),getPluginVersion(hLib));
			FreeLibrary(hLib);
			return eLoadFailedError;
		}
		else
		{
			lpProc = (int (__cdecl *)(const char*, void*))GetProcAddress(hLib, "bzwb_Load");
			if (lpProc)
			{
				lpProc(config.c_str(),hLib);
				printf("Plugin:%s loaded\n",plugin.c_str());

				trPluginRecord pluginRecord;
				pluginRecord.foundPath = realPluginName;
				pluginRecord.handle = hLib;
				pluginRecord.plugin = plugin;
				vPluginList.push_back(pluginRecord);
			}
			else
			{
				printf("Plugin:%s found but does not contain bzwb_Load method\n",plugin.c_str());
				FreeLibrary(hLib);
				return eLoadFailedError;
			}
		}
	}
	else
	{
		printf("Plugin:%s not found\n",plugin.c_str());
		return eLoadFailedError;
	}

	return eLoadComplete;
}
Ejemplo n.º 4
0
void mostVesselTracerPlugin::domenu(const QString & menu_name, V3DPluginCallback2 & v3d, QWidget * parent)
{
    if (menu_name == tr("Set Seeds"))
    {
        setSeeds(v3d, parent);
    }
    else if (menu_name == tr("Start tracing"))
    {
        set_dialog(v3d, parent);

       // startVesselTracing( v3d , parent );
    }
    else
    {
        QString msg = QString("MOST Vessel Tracing Plugin version %1\n initially developed by Jingpeng Wu (jpwu@CBMP) and refined slightly by Hanchuan Peng")
                      .arg(getPluginVersion(), 1, 'f', 1);
        QMessageBox::information(parent, "Version info", msg);
    }
}
Ejemplo n.º 5
0
void ExtraFilters::processImage(const QString &arg, Image4DSimple *image, QWidget *parent)
{
	if (! image) return;

	unsigned char* data1d = image->getRawData();
	V3DLONG N = image->getTotalBytes();

	//throw("hello intentional error");

    if (arg == tr("Invert Color"))
    {
        for (V3DLONG i = 0; i < N; i++)
        {
        	data1d[i] = 255 - data1d[i];
        }
    }
    else
    if (arg == tr("Threshold..."))
    {
        bool ok;
        int threshold = QInputDialog::getInteger(parent, tr("Threshold"),
                                                 tr("Enter threshold:"),
                                                 100, 0, 255, 1, &ok);
        if (ok)
        {
            for (V3DLONG i = 0; i < N; i++)
            {
            	if (data1d[i] <= threshold)
            		data1d[i] = 0;
            }
        }
    }
    else
    {
    	QMessageBox::information(parent, title, 
                QString("V3DSingleImageInterface Demo version %1"
    			"\ndeveloped by Zongcai Ruan 2009. (Janelia Farm Research Campus, HHMI)")
                .arg(getPluginVersion()));
    }
}
Ejemplo n.º 6
0
void BWLabelNPlugin::domenu(const QString &menu_name, V3DPluginCallback2 &callback, QWidget *parent)
{
    if (menu_name == tr("3D"))
    {
    	bwlabelimg(callback, parent, 3); //3 - 3D
    }
	else if (menu_name == tr("2D (for all individual Z-sections)"))
	{
    	bwlabelimg(callback, parent, 2); //2 - 2D
	}
	else if (menu_name == tr("about"))
	{
    	v3d_msg(QString("This plugin thresholds an image and then labels all image objects. Developed by Hanchuan Peng, by wrapping Fuhui Long's original code. (version %1)").arg(getPluginVersion())); 
	}
}
Ejemplo n.º 7
0
void FLCellSegPlugin::domenu(const QString &menu_name, V3DPluginCallback2 &callback, QWidget *parent)
{
    if (menu_name == tr("Segment all image objects (adaptive thresholding followed by watershed)"))
    {
    	FL_cellseg(callback, parent); 
    }
	else if (menu_name == tr("about"))
	{
        v3d_msg(QString("This plugin uses Fuhui Long's cell segmentation program to detect and label 3D image objects. (version %1)").arg(getPluginVersion()));
	}
}