- sprintf(temp,"%d\0",dimX);
- f->InsertEntryString(temp,0x0028,0x0011); // Columns
- sprintf(temp,"%d\0",dimY);
- f->InsertEntryString(temp,0x0028,0x0010); // Rows
-
- f->InsertEntryString("8",0x0028,0x0100); // Bits Allocated
- f->InsertEntryString("8",0x0028,0x0101); // Bits Stored
- f->InsertEntryString("7",0x0028,0x0102); // High Bit
- f->InsertEntryString("0",0x0028,0x0103); // Pixel Representation
- f->InsertEntryString("1",0x0028,0x0002); // Samples per Pixel
- f->InsertEntryString("MONOCHROME2 ",0x0028,0x0004);
-
- // We need a gdcm::FileHelper, since we want to load the pixels
- gdcm::FileHelper *fh = gdcm::FileHelper::New(f);
+ sprintf(temp,"%d ",dimX);
+ f2->InsertEntryString(temp,0x0028,0x0011, "US"); // Columns
+ sprintf(temp,"%d ",dimY);
+ f2->InsertEntryString(temp,0x0028,0x0010, "US"); // Rows
+
+ f2->InsertEntryString("8",0x0028,0x0100, "US"); // Bits Allocated
+ f2->InsertEntryString("8",0x0028,0x0101, "US"); // Bits Stored
+ f2->InsertEntryString("7",0x0028,0x0102, "US"); // High Bit
+ f2->InsertEntryString("0",0x0028,0x0103, "US"); // Pixel Representation
+ f2->InsertEntryString("1",0x0028,0x0002, "US"); // Samples per Pixel
+ f2->InsertEntryString("MONOCHROME2 ",0x0028,0x0004, "LO");
+
+
+ // feel free to add any field (Dicom Data Entry) you like, here.
+ // ...
+ GDCM_NAME_SPACE::FileHelper *fh = GDCM_NAME_SPACE::FileHelper::New(f2);