Commit fbb50ee7 authored by Vladimír Ulman's avatar Vladimír Ulman Committed by Vladimír Ulman
Browse files

Besides some typos in the official DEBUG messages, the support

for creating local single-cell masks has been "enhanced". That is,
the new created local image considers only 80% of the simulation
(it still does not consider sceneMasks, though).

M    src/toolbox/bp_lists.cpp
M    src/toolbox/bp_lists.h
parent b3c5a782
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ void RenderBPListIntoMask(i3d::Image3d<MV> &mask, const MV value,
	       << i3d::PixelsToMicrons(mask.GetSize(),mask.GetResolution())  << " in microns");

	if (BPList.size() == 0) {
		REPORT("Warning, empty list given, nothing really rendered.");
		REPORT("Warning: Empty list given, nothing really rendered.");
		return;
	}

@@ -504,7 +504,7 @@ void RenderBPListIntoMask(i3d::Image3d<MV> &mask, const MV value,
			//translate local myMask coordinates to the mask coordinates by +pixelShift
			if ( (! *mb) && (mask.GetOffset().x == 0.f)
			   && (mask.GetVoxel(x+pixelShift.x,y+pixelShift.y,z+pixelShift.z)) )
					REPORT("Warning: overwriting value "
					REPORT("Warning: Overwriting value "
					  << mask.GetVoxel(i3d::Vector3d<int>(x,y,z)+pixelShift)
					  << " at pixel " << i3d::Vector3d<int>(x,y,z)+pixelShift);
#endif
@@ -624,7 +624,7 @@ void RenderBPListIntoMask(i3d::Image3d<MV> &mask, const MV value,
	       << i3d::PixelsToMicrons(mask.GetSize(),mask.GetResolution())  << " in microns");

	if (BPList.size() == 0) {
		REPORT("Warning, empty list given, nothing really rendered.");
		REPORT("Warning: Empty list given, nothing really rendered.");
		return;
	}

@@ -704,7 +704,7 @@ void RenderBPListIntoMask(i3d::Image3d<MV> &mask, const MV value,
		   	i3d::GRAY8 *mb=mB +z*Slice +y*xLine +x;
#ifdef MITOGEN_DEBUG
			if ((! *mb) && (mask.GetVoxel(x,y,z)) && (mask.GetOffset().x == 0.f))
				REPORT("Warning: overwriting value " << mask.GetVoxel(x,y,z)
				REPORT("Warning: Overwriting value " << mask.GetVoxel(x,y,z)
				  << " at pixel (" << x << "," << y << "," << z << ")");
#endif
			//dilation of this pixel
@@ -812,7 +812,7 @@ void SoftRenderBPListIntoMask(i3d::Image3d<MV> &mask, const MV value,
	       << i3d::PixelsToMicrons(mask.GetSize(),mask.GetResolution())  << " in microns");

	if (BPList.size() == 0) {
		REPORT("Warning, empty list given, nothing really rendered.");
		REPORT("Warning: Empty list given, nothing really rendered.");
		return;
	}

@@ -926,7 +926,7 @@ void SoftRenderBPListIntoMask(i3d::Image3d<MV> &mask, const MV value,
			//translate local myMask coordinates to the mask coordinates by +pixelShift
			if ( (! *mb) && (mask.GetOffset().x == 0.f)
			   && (mask.GetVoxel(x+pixelShift.x,y+pixelShift.y,z+pixelShift.z)) )
					REPORT("Warning: overwriting value "
					REPORT("Warning: Overwriting value "
					  << mask.GetVoxel(i3d::Vector3d<int>(x,y,z)+pixelShift)
					  << " at pixel " << i3d::Vector3d<int>(x,y,z)+pixelShift);
#endif
@@ -1069,7 +1069,7 @@ void AllocateAndZeroNewMask(i3d::Image3d<MV> &mask,
	float zTo= -100000000000000.f;

	if (BPList.size() == 0) {
		REPORT("Warning, empty list given, nothing really rendered. Input image not resized!");
		REPORT("Warning: Empty list given, nothing really rendered. Input image not resized!");
		return;
	}

@@ -1099,10 +1099,10 @@ void AllocateAndZeroNewMask(i3d::Image3d<MV> &mask,

	//second, add boundary required when considering only motion of cell
	const float xySize=std::max((xTo-xFrom), (yTo-yFrom));
	const float maxTranslationXY=2.f*((float)noFrames+0.1f)*cellLookDistance;
	const float maxTranslationXY=2.f*((float)noFrames+0.1f)*0.8f*cellLookDistance; //80%
	xSize+=(size_t)ceilf( (maxTranslationXY + xySize-(xTo-xFrom)) * mask.GetResolution().GetX() );
	ySize+=(size_t)ceilf( (maxTranslationXY + xySize-(yTo-yFrom)) * mask.GetResolution().GetY() );
	zSize+=(size_t)ceilf( 4.f*(float)noFrames+0.2f );
	zSize+=(size_t)ceilf( 3.5f*(float)noFrames+0.2f ); //3.5 = 4 * 80%

			  //cell_centre  minus  half_of_the_size_in_microns
	//const float xOff=(xTo+xFrom)/2.f - 0.5*xSize/mask.GetResolution().GetX();
+2 −1
Original line number Diff line number Diff line
@@ -150,9 +150,10 @@ void SoftRenderBPListIntoMask(i3d::Image3d<MV> &mask, const MV value,
 * required width to accomodate motion of cell in the coming \e noFrames
 * time points. The xy-plane is considered separately from the z-axis.
 * The width and height in the xy-plane is computed as the greater from cell
 * width or height plus 2 * (\e noFrames+0.1) times the constant
 * width or height plus 2 * (\e noFrames+0.1) times 80% of the constant
 * cellLookDistance from constants.h (note that cellLookDistance is hard
 * maximum length of translational movement of a cell between frame to frame).
 * It is assumed that cell will never walk directly, hence the cut to 80%.
 * The width of "extra boundary" along the z-axis is \e noFrames+0.1 times
 * 1/resolution_in_z_axis (i.e. the width of one pixel in microns). This is
 * because a cell is allowed to move max 1px in z-direction between frames