Index: sansmodels/src/c_gen/sld2i.cpp
===================================================================
--- sansmodels/src/c_gen/sld2i.cpp	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
+++ sansmodels/src/c_gen/sld2i.cpp	(revision b1174ec4ec9164d6823c827cb03dad5e55b43a97)
@@ -29,5 +29,5 @@
  */
 GenI :: GenI(int npix, double* x, double* y, double* z, double* sldn,
-			double* mx, double* my, double* mz,
+			double* mx, double* my, double* mz, double* voli,
 			double in_spin, double out_spin,
 			double s_theta) {
@@ -43,4 +43,5 @@
 	this->my_val = my;
 	this->mz_val = mz;
+	this->vol_pix = voli;
 	this->inspin = in_spin;
 	this->outspin = out_spin;
@@ -52,4 +53,5 @@
  */
 void GenI :: genicom(int npoints, double *qx, double *qy, double *I_out){
+	// Assumes that q doesn't have qz component and sld_n is all real
 	double q = 0.0;
 	//double Pi = 4.0*atan(1.0);
@@ -66,6 +68,6 @@
 	complex temp_fi;
 
-	int count = 0;
-	//Assume that all pixels are in same size and int * 1A
+	double count = 0.0;
+	//Assume that pixel volumes are given in vol_pix in A^3 unit
 	//int x_size = 0; //in Ang
 	//int y_size = 0; //in Ang
@@ -81,5 +83,5 @@
 		sumj_dd = cassign(0.0, 0.0);		
 		//printf ("%d ", i);
-		q = sqrt(qx[i]*qx[i] + qy[i]*qy[i]);
+		q = sqrt(qx[i]*qx[i] + qy[i]*qy[i]); // + qz[i]*qz[i]);
 
 		for(int j=0; j<n_pix; j++){
@@ -98,4 +100,5 @@
 					comp_sld = cassign(b_sld.uu, 0.0);
 					temp_fi = cplx_mult(comp_sld, ephase);
+					temp_fi = rcmult(vol_pix[j],temp_fi);
 					sumj_uu = cplx_add(sumj_uu, temp_fi);
 					}
@@ -104,4 +107,5 @@
 					comp_sld = cassign(b_sld.dd, 0.0);
 					temp_fi = cplx_mult(comp_sld, ephase);
+					temp_fi = rcmult(vol_pix[j],temp_fi);
 					sumj_dd = cplx_add(sumj_dd, temp_fi);
 					}
@@ -110,4 +114,5 @@
 					comp_sld = cassign(b_sld.re_ud, b_sld.im_ud);
 					temp_fi = cplx_mult(comp_sld, ephase);
+					temp_fi = rcmult(vol_pix[j],temp_fi);
 					sumj_ud = cplx_add(sumj_ud, temp_fi);
 					}
@@ -116,8 +121,9 @@
 					comp_sld = cassign(b_sld.re_du, b_sld.im_du);
 					temp_fi = cplx_mult(comp_sld, ephase);
+					temp_fi = rcmult(vol_pix[j],temp_fi);
 					sumj_du = cplx_add(sumj_du, temp_fi);
 					}
 				if (i == 0){
-					count += 1;
+					count += vol_pix[j];
 				}
 			}
Index: sansmodels/src/c_gen/sld2i.hh
===================================================================
--- sansmodels/src/c_gen/sld2i.hh	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
+++ sansmodels/src/c_gen/sld2i.hh	(revision b1174ec4ec9164d6823c827cb03dad5e55b43a97)
@@ -26,4 +26,5 @@
 	double* my_val;
 	double* mz_val;
+	double* vol_pix;
     // spin ratios
     double inspin;
@@ -34,5 +35,5 @@
     // Constructor
 	GenI(int npix, double* x, double* y, double* z, double* sldn, 
-			double* mx, double* my, double* mz, 
+			double* mx, double* my, double* mz, double* voli,
 			double in_spin, double out_spin,
 			double s_theta);
Index: sansmodels/src/c_gen/sld2i_module.cpp
===================================================================
--- sansmodels/src/c_gen/sld2i_module.cpp	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
+++ sansmodels/src/c_gen/sld2i_module.cpp	(revision b1174ec4ec9164d6823c827cb03dad5e55b43a97)
@@ -42,4 +42,5 @@
 	PyObject *my_val_obj;
 	PyObject *mz_val_obj;
+	PyObject *vol_pix_obj;
 	Py_ssize_t n_x;
 	//PyObject rlimit_obj;
@@ -55,9 +56,10 @@
 	double* my_val;
 	double* mz_val;
+	double* vol_pix;
 	double inspin;
 	double outspin;
 	double stheta;
 
-	if (!PyArg_ParseTuple(args, "iOOOOOOOddd", &n_pix, &x_val_obj, &y_val_obj, &z_val_obj, &sldn_val_obj, &mx_val_obj, &my_val_obj, &mz_val_obj, &inspin, &outspin, &stheta)) return NULL;
+	if (!PyArg_ParseTuple(args, "iOOOOOOOOddd", &n_pix, &x_val_obj, &y_val_obj, &z_val_obj, &sldn_val_obj, &mx_val_obj, &my_val_obj, &mz_val_obj, &vol_pix_obj, &inspin, &outspin, &stheta)) return NULL;
 	OUTVECTOR(x_val_obj, x_val, n_x);
 	OUTVECTOR(y_val_obj, y_val, n_x);
@@ -67,5 +69,6 @@
 	OUTVECTOR(my_val_obj, my_val, n_x);
 	OUTVECTOR(mz_val_obj, mz_val, n_x);
-	GenI* sld2i = new GenI(n_pix,x_val,y_val,z_val,sldn_val,mx_val,my_val,mz_val,inspin,outspin,stheta);
+	OUTVECTOR(vol_pix_obj, vol_pix, n_x);
+	GenI* sld2i = new GenI(n_pix,x_val,y_val,z_val,sldn_val,mx_val,my_val,mz_val,vol_pix,inspin,outspin,stheta);
 	return PyCObject_FromVoidPtr(sld2i, del_sld2i);
 }
