#include #include #include #include #include #include #include #include #include #include #define pi 3.14159 void ivote3(float* center, float* img, float std[], float anisotropy, float phi, float d_phi, unsigned int r[], int iter, float t, unsigned int conn[], unsigned int x, unsigned int y, unsigned int z); void invert_data(float* cpuI, unsigned int x, unsigned int y, unsigned int z){ for(int ix = 0; ix < x; ix++){ for (int iy = 0; iy < y; iy++){ for (int iz = 0; iz < z; iz++){ int idx = iz * x * y + iy * x + ix; cpuI[idx] = 255 - cpuI[idx]; } } } } int main(int argc, char** argv){ cudaDeviceProp prop; int count; cudaGetDeviceCount(&count); //printf("cudadevicecount: %i\n", count); for (int i=0; iimgrad3; imgrad3.set_interleaved3(cpu_out, 128,128,128,3); std::ofstream fgx("syn/gx-128.vol", std::ofstream::out | std::ofstream::binary); fgx.write((char*)imgrad3.channel(0).data(), bytes); fgx.close(); */ //write the output file. std::ofstream fo("shared2D-v8/" + OutName.str(), std::ofstream::out | std::ofstream::binary); fo.write((char*)cpu_out, bytes); fo.close(); // creat a file for saving the list centers std::ofstream list("shared2D-v8/center.txt"); if (list.is_open()){ for (int ix=0; ix