out->SetScalarType(first->GetScalarType());
int ext[6];
first->GetExtent(ext);
- //ext[5] = im.size()-1; // JPR
- ext[5] = ext[5] * im.size()-1; // deal with multiframes //JPR
+ if(ext[5] == 0)
+ {
+ ext[5] = im.size()-1;
+ }
+ else
+ {
+ ext[5] = ext[5] * im.size()-1; // to deal with multiframes - JPR
+ }
out->SetExtent(ext);
// LG : TODO : Z Spacing ?
std::vector<std::string>::iterator it;
for (it=im.begin(); it!=im.end(); ++it)
{
- //std::cout << "copying slice "<<slice <<std::endl;
+
vtkImageData* cur = mReader.GetImage( (*it));
-
- void* src = cur->GetScalarPointer(0,0,0);
- void* dst = out->GetScalarPointer(0,0,slice);
- // std::cout << "src="<<src<<std::endl;
- // std::cout << "dst="<<dst<<std::endl;
- // std::cout << "siz="<<imsize<<std::endl;
- std::cout << slice;
- memcpy(dst,src,imsize);
+ // void* src = cur->GetScalarPointer(0,0,0);
+ // void* dst = out->GetScalarPointer(0,0,slice);
+ memcpy(out->GetScalarPointer(0,0,slice),cur->GetScalarPointer(0,0,0),imsize);
slice++;
}