main.cpp 1.79 KB
#include <iostream>
#include <fstream>
#include <cuda_runtime.h>
#include <stim/math/vector.h>
#include <stim/parser/arguments.h>
#include <stim/parser/filename.h>
#include <stim/grids/image_stack.h>
#include <stim/grids/grid.h>
#include <stim/visualization/colormap.h>

#define pi	3.14159

void gaussian_blur_conv3(float* blur, float* img, float std, unsigned int x, unsigned int y, unsigned int z);

int main(){

	float sigma =5;

	// load the imagestack from the given directory
	std::string file_mask = "D:\\source\\ivote3\\data\\nissl\\*.png";
	stim::image_stack<float> I;
	unsigned int x =512;
	unsigned int y =512;
	unsigned int z =512;
	unsigned int bytes = x*y*z* sizeof(float);
	stim::vec<unsigned int> R(x, y, z);"D:\\source\\ivote3\\data\\nissl\\nissl-rat.vol", 512, 512, 512, 1, 12);
	//float test = I.get(128, 128, 128);
	//std::cout<< test<<std::endl;
	float* ptr0 =;
	float* cpuI = (float*) malloc(512*512*512*sizeof(float));	
	memcpy (cpuI, ptr0, bytes);
	std::ofstream outfile ("data\\original.vol");
	outfile.write((char*)cpuI, 512*512*512);

	float* cpuIb = (float*) malloc(512*512*512*sizeof(float));	
	gaussian_blur_conv3(cpuIb, cpuI, sigma, x, y, z);
	std::ofstream blurfile ("data\\IBlur.vol");
	blurfile.write((char*)cpuIb, 512*512*512);
	//int n = memcmp(cpuI, ptr0, bytes);
	//std::cout << n << std::endl;
	//std::cin >> n;

	//multiply(cpuI, 10, x*y*z);
	//int n = memcmp (cpuI, ptr0, bytes);
	//std::cout << n << std::endl;
	//std::fstream file2;
	//file2.write((char*)cpuI, 512*512*512*sizeof(unsigned char));
	//test = ptr0[128*128*128];
	//std::cout<< test<<std::endl;
	//std::cin>> x;

	//memset(, 0, 512*512*512);


//			cudaDeviceReset();