10 #include <boost/date_time/posix_time/posix_time.hpp> 12 #include <fwTools/dateAndTime.hpp> 14 #include <fwAtoms/Numeric.hpp> 15 #include <fwAtoms/String.hpp> 16 #include <fwAtoms/Sequence.hpp> 17 #include <fwAtomsPatch/StructuralCreatorDB.hpp> 18 #include <fwAtomsPatch/helper/Object.hpp> 19 #include <fwAtomsPatch/infos/Logger.hpp> 21 #include "fwStructuralPatch/fwData/Acquisition/V1ToFwMedDataImageSeriesV1.hpp" 57 const ::fwAtoms::Object::sptr& current,
58 ::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
60 IStructuralPatch::apply(previous, current, newVersions);
103 helper.
addAttribute(
"patient", creators->create(
"::fwMedData::Patient",
"1") );
106 helper.
addAttribute(
"equipment", creators->create(
"::fwMedData::Equipment",
"1") );
109 helper.
addAttribute(
"study", creators->create(
"::fwMedData::Study",
"1") );
112 helper.
addAttribute(
"performing_physicians_name", ::fwAtoms::Sequence::New());
118 std::string creationDate = previous->getAttribute(
"creation_date")->getString();
121 ::boost::posix_time::ptime pdate =
122 ::boost::posix_time::time_from_string(creationDate);
123 const std::string date = ::fwTools::getDate(pdate);
124 const std::string time = ::fwTools::getTime(pdate);
FWSTRUCTURALPATCH_API V1ToFwMedDataImageSeriesV1()
Constructor.
Transforms an acquisition in version '1' to an image series in version '1'.
FWATOMSPATCH_API void updateVersion(std::shared_ptr< ::fwAtoms::Object > current)
Updates the version of the patched object.
static FWATOMS_API String::sptr New(std::string value)
Construct a new Object represented a string.
FWATOMSPATCH_API void renameAttribute(const std::string &name, const std::string &newName, conditions::Abstract::sptr condition=conditions::Abstract::New())
Renames an attribute.
FWATOMSPATCH_API void removeAttribute(const std::string &name, conditions::Abstract::sptr condition=conditions::Abstract::New())
Removes an attribute.
Contains base functionalities used to transform objects from a version to another.
virtual FWSTRUCTURALPATCH_API void apply(const ::fwAtoms::Object::sptr &previous, const ::fwAtoms::Object::sptr ¤t,::fwAtomsPatch::IPatch::NewVersionsType &newVersions) override
Applies patch.
std::string m_targetClassname
Target type.
FWATOMSPATCH_API IStructuralPatch()
Constructor.
std::string m_originClassname
Origin classname of the object.
Contains creators and structural patches.
std::string m_originVersion
Origin version of the object.
FWATOMSPATCH_API void addAttribute(const std::string &name,::fwAtoms::Base::sptr value, conditions::Abstract::sptr condition=conditions::Abstract::New())
Adds a new attribute in the current object.
std::string m_targetVersion
Target version.
static StructuralCreatorDB::sptr getDefault()
Returns the default instance of StructuralCreatorDB.
Contains the representation of the data objects used in the framework.
FWSTRUCTURALPATCH_API ~V1ToFwMedDataImageSeriesV1()
Destructor.