function X = WaveletRecon3D(lclrlt, lchrlt, hclrlt, hchrlt, lclrht, lchrht, hclrht, hchrht, g0, g1)

[numrowsd, numcolsd, numtimed] = size(lclrlt);

% Upsample Time
lclrlt_u = zeros(numrowsd, numcolsd, numtimed*2);
lchrlt_u = zeros(numrowsd, numcolsd, numtimed*2); 
hclrlt_u = zeros(numrowsd, numcolsd, numtimed*2); 
hchrlt_u = zeros(numrowsd, numcolsd, numtimed*2); 
lclrht_u = zeros(numrowsd, numcolsd, numtimed*2); 
lchrht_u = zeros(numrowsd, numcolsd, numtimed*2);
hclrht_u = zeros(numrowsd, numcolsd, numtimed*2);
hchrht_u = zeros(numrowsd, numcolsd, numtimed*2);
lclrlt_u(:,:, 1:2:end) = lclrlt;
lchrlt_u(:,:, 1:2:end) = lchrlt;
hclrlt_u(:,:, 1:2:end) = hclrlt;
hchrlt_u(:,:, 1:2:end) = hchrlt;
lclrht_u(:,:, 1:2:end) = lclrht;
lchrht_u(:,:, 1:2:end) = lchrht;
hclrht_u(:,:, 1:2:end) = hclrht;
hchrht_u(:,:, 1:2:end) = hchrht;

%Filter time using reconstruction filter
lclr = zeros(numrowsd, numcolsd, numtimed*2);
lchr = zeros(numrowsd, numcolsd, numtimed*2);
hclr = zeros(numrowsd, numcolsd, numtimed*2);
hchr = zeros(numrowsd, numcolsd, numtimed*2);

for i=1:numcolsd
   for j=1:numrowsd
   	lclr(j,i,:) = filter(g0, 1, lclrlt_u(j,i,:)) + filter(g1, 1, lclrht_u(j,i,:)); 
      lchr(j,i,:) = filter(g0, 1, lchrlt_u(j,i,:)) + filter(g1, 1, lchrht_u(j,i,:));
      hclr(j,i,:) = filter(g0, 1, hclrlt_u(j,i,:)) + filter(g1, 1, hclrht_u(j,i,:));
      hchr(j,i,:) = filter(g0, 1, hchrlt_u(j,i,:)) + filter(g1, 1, hchrht_u(j,i,:));
	end
end

% Upsample Rows (add columns)
lclr_u = zeros(numrowsd, numcolsd*2, numtimed*2);
lchr_u = zeros(numrowsd, numcolsd*2, numtimed*2);
hclr_u = zeros(numrowsd, numcolsd*2, numtimed*2);
hchr_u = zeros(numrowsd, numcolsd*2, numtimed*2);
lclr_u(:, 1:2:end, :) = lclr;
lchr_u(:, 1:2:end, :) = lchr;
hclr_u(:, 1:2:end, :) = hclr;
hchr_u(:, 1:2:end, :) = hchr;

% Filter Rows using reconstruction filter

low_col = zeros(numrowsd, numcolsd*2, numtimed*2);
high_col = zeros(numrowsd, numcolsd*2, numtimed*2);
for t=1:numtimed*2
	for j=1:numrowsd
	    low_col(j,:,t) = filter(g0, 1, lclr_u(j,:,t)) + filter(g1, 1, lchr_u(j,:,t));
	    high_col(j,:,t) = filter(g0, 1, hclr_u(j,:,t)) + filter(g1, 1, hchr_u(j,:,t));
	end
end

% Upsample Columns (add rows)
low_col_u = zeros(numrowsd*2, numcolsd*2, numtimed*2);
high_col_u = zeros(numrowsd*2, numcolsd*2, numtimed*2);
low_col_u(1:2:end, :, :) = low_col;
high_col_u(1:2:end, :, :) = high_col;

X = zeros(numrowsd*2, numcolsd*2, numtimed*2);
for t = 1:numtimed*2
	for i = 1:numcolsd*2    
	    X(:,i, t) = filter(g0, 1, low_col_u(:,i, t)) +  filter(g1, 1, high_col_u(:,i,t ));
	end    
end