Giter VIP home page Giter VIP logo

Comments (4)

sbonaretti avatar sbonaretti commented on June 25, 2024 1

Thanks! Got it! For anybody who might need it in python:

After reading the image:

ImageType = itk.Image[itk.ctype('signed short'), 3]
reader = itk.ImageFileReader[ImageType].New()
imageio = itk.ScancoImageIO.New()
reader.SetImageIO(imageio)
reader.SetFileName(file_name) # change to your filename here
reader.Update()

Get the header fields:

print(imageio.GetPatientIndex())
print(imageio.GetScannerID())
print(imageio.GetSliceThickness())
print(imageio.GetSliceIncrement())
print(imageio.GetStartPosition())
print(imageio.GetMuScaling())
print(imageio.GetNumberOfSamples())
print(imageio.GetNumberOfProjections())
print(imageio.GetScanDistance())
print(imageio.GetScannerType())
print(imageio.GetSampleTime())
print(imageio.GetMeasurementIndex())
print(imageio.GetSite())
print(imageio.GetReferenceLine())
print(imageio.GetReconstructionAlg())
print(imageio.GetEnergy())
print(imageio.GetIntensity())
print(imageio.GetPatientName())

from itkioscanco.

thewtex avatar thewtex commented on June 25, 2024

A number of the import header elements are exposed in the itk.ScancoImageIO class:

itkGetConstMacro( PatientIndex, int );
itkSetMacro( PatientIndex, int );
itkGetConstMacro( ScannerID, int );
itkSetMacro( ScannerID, int );
itkGetConstMacro( SliceThickness, double );
itkSetMacro( SliceThickness, double );
itkGetConstMacro( SliceIncrement, double );
itkSetMacro( SliceIncrement, double );
itkGetConstMacro( StartPosition, double );
itkSetMacro( StartPosition, double );
/** Set / Get the minimum and maximum values */
const double * GetDataRange() const { return this->m_DataRange; }
void SetDataRange( const double * dataRange )
{
this->m_DataRange[0] = dataRange[0];
this->m_DataRange[1] = dataRange[1];
}
itkGetConstMacro( MuScaling, double );
itkSetMacro( MuScaling, double );
itkGetConstMacro( NumberOfSamples, int );
itkSetMacro( NumberOfSamples, int );
itkGetConstMacro( NumberOfProjections, int );
itkSetMacro( NumberOfProjections, int );
itkGetConstMacro( ScanDistance, double );
itkSetMacro( ScanDistance, double );
itkGetConstMacro( ScannerType, int );
itkSetMacro( ScannerType, int );
itkGetConstMacro( SampleTime, double );
itkSetMacro( SampleTime, double );
itkGetConstMacro( MeasurementIndex, int );
itkSetMacro( MeasurementIndex, int );
itkGetConstMacro( Site, int );
itkSetMacro( Site, int );
itkGetConstMacro( ReferenceLine, int );
itkSetMacro( ReferenceLine, int );
itkGetConstMacro( ReconstructionAlg, int );
itkSetMacro( ReconstructionAlg, int );
/** Get a string that states patient name.
* Max size: 40 characters. */
const char *GetPatientName() const { return this->m_PatientName; }
void SetPatientName( const char * version )
{
strcpy(this->m_PatientName, version);
this->Modified();
}
itkGetConstMacro( Energy, double );
itkSetMacro( Energy, double );
itkGetConstMacro( Intensity, double );
itkSetMacro( Intensity, double );

from itkioscanco.

sbonaretti avatar sbonaretti commented on June 25, 2024

Hi,
Is there any way to get CreationDate and ModificationDate in python?
Thanks a lot,
Serena

from itkioscanco.

thewtex avatar thewtex commented on June 25, 2024

Hi @sbonaretti ,

Yes, this should do it: #30

from itkioscanco.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.