| 56 | } |
| 57 | |
| 58 | Image |
| 59 | ImportAsUInt8(uint8_t * buffer, |
| 60 | const std::vector<unsigned int> & size, |
| 61 | const std::vector<double> & spacing, |
| 62 | const std::vector<double> & origin, |
| 63 | const std::vector<double> & direction, |
| 64 | unsigned int numberOfComponents) |
| 65 | { |
| 66 | ImportImageFilter import; |
| 67 | import.SetSize(size); |
| 68 | import.SetSpacing(spacing); |
| 69 | import.SetOrigin(origin); |
| 70 | import.SetDirection(direction); |
| 71 | import.SetBufferAsUInt8(buffer, numberOfComponents); |
| 72 | return import.Execute(); |
| 73 | } |
| 74 | |
| 75 | Image |
| 76 | ImportAsInt16(int16_t * buffer, |