Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision a2e6a2b1dd1da48e502fc25126aa9b8a139ed543 authored by GUANGMING ZANG on 13 August 2018, 08:44:48 UTC, committed by GitHub on 13 August 2018, 08:44:48 UTC
Update README.md
1 parent 80d039c
  • Files
  • Changes
  • 6fa5ac5
  • /
  • SpaceTimeTomography
  • /
  • ImageFormationModel
  • /
  • VolumeData.cpp
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:a2e6a2b1dd1da48e502fc25126aa9b8a139ed543
directory badge
swh:1:dir:314b434087cc08ec6b52c9a3e3f3261667e88ff4
content badge
swh:1:cnt:07fa9fa39578dab7be2d1a1d78e700d9571cdccd

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
VolumeData.cpp
// VolumeData.cpp

#include "VolumeData.h"
#include <malloc.h>
#include <fstream>

#include <iostream>

using namespace  std;



VolumeData::VolumeData()
{
	m_Dims[0]=128;
	m_Dims[1]=128;
	m_Dims[2]=128;
	m_Spacings[0]=m_Spacings[1]=m_Spacings[2]=1.0f;

	int _index=0 ;
	
	m_IsBackProjectMode=false;

}


 VolumeData::VolumeData(int d1,int d2, int d3, float sp1,float sp2,float sp3,float *data)
{
	int d[]={d1,d2,d3};
	this->SetDimensions(d);
	float sp[]={sp1,sp2,sp3};
	this->SetSpacings(sp);
	this->_allocate();
}



 void VolumeData::setParas(int *vols, double vs,int nframes)
 {
	 m_volX= vols[0];
	 m_volY= vols[1];
	 m_volZ= vols[2];
	 Vol_Spacing=vs;
	 m_nframes = nframes;

 }
 
VolumeData::~VolumeData()
{
	Clean();
}

void VolumeData::Clean()
{

	
}


void VolumeData::_allocate()
{
	
}



void VolumeData::GetDimensions(int *dims) const
{
	dims[0]=m_Dims[0]; dims[1]=m_Dims[1]; dims[2]=m_Dims[2];
}

void VolumeData::SetDimensions(const int *dims)
{
	m_Dims[0]=dims[0]; m_Dims[1]=dims[1]; m_Dims[2]=dims[2];
}

void VolumeData::GetSpacings(float *spacings) const
{
	spacings[0]=m_Spacings[0]; spacings[1]=m_Spacings[1]; spacings[2]=m_Spacings[2];
}

void VolumeData::SetSpacings(const float *spacings)
{
	m_Spacings[0]=spacings[0]; m_Spacings[1]=spacings[1]; m_Spacings[2]=spacings[2];
}


CImg<float> VolumeData::GetData(int iframe)
{
	return m_Volumelist[iframe];
	//return 0;
}

void  VolumeData::SetData(CImgList<float> _vol_list)
{
	//m_Data = _data;
	//return true;
	m_Volumelist= _vol_list;
}



void VolumeData::ReadStructuredFile()
{
	m_Dims[0]=m_volX;
	m_Dims[1]=m_volY;
	m_Dims[2]=m_volZ;
	m_Spacings[0]=m_Spacings[1]=m_Spacings[2]=Vol_Spacing;  

	m_Flowlist = CImgList<float>(m_nframes, m_Dims[0], m_Dims[1], m_Dims[2], 3, 0);

	char basename[1024];
	sprintf(basename, "Input");
	//rose.-000-frame-9iter
	for (int i = 0; i < m_nframes; i++)
	{
		char temp[200];
		
		sprintf(temp, "%s/rose.-%03d-frame-9iter.tiff", basename, i);

		m_Volumelist.insert(CImg<float>(temp));

	}
	// init the time steps as n+1 
	// in case potential boundary issue.
	m_Volumelist.insert(m_Volumelist[m_nframes - 1]);

	
}

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API